Discuss Scratch

erehzuwlamA
Scratcher
56 posts

Decoding FEN strings in Scratch

My project so far: https://scratch.mit.edu/projects/991085034/
FEN definition: https://www.chess.com/terms/fen-chess

I need help making a script that can decode FEN strings. my idea is for the script to look at each character of the FEN and associate it with a square on the screen and if it has a chess piece or not. someone help me, this is gonna be somewhat complex. Maybe someone can make a script that could accomplish this?

when green flag clicked
say [Hello World!]

Hey, I'm erehzuwlamA! I make games, animations, and art! My dream is to be a game developer.

I can give out coding advice.
MineTurte
Scratcher
500+ posts

Decoding FEN strings in Scratch

erehzuwlamA wrote:

My project so far: https://scratch.mit.edu/projects/991085034/
FEN definition: https://www.chess.com/terms/fen-chess

I need help making a script that can decode FEN strings. my idea is for the script to look at each character of the FEN and associate it with a square on the screen and if it has a chess piece or not. someone help me, this is gonna be somewhat complex. Maybe someone can make a script that could accomplish this?
I would put the code in forums but it's quite long and I'd loose my sanity trying to do that. You could use something I made before that is pretty close to you want; you can just customize it to what you'd like.
Link: https://scratch.mit.edu/projects/941476534/

Hope this is want you were looking for (and hope I helped)!

(pronouns are she/her). Advanced Alpha Game Studios Manager. Our website: https://aags2.w3spaces.com
This is JuniperActias. AKA Moth mommy. If I helped you out consider following Juni-Bug (my new account)!




If you found this secret, say uwu
Signature gradients here













erehzuwlamA
Scratcher
56 posts

Decoding FEN strings in Scratch

Honestly that project didnt really help me

when green flag clicked
say [Hello World!]

Hey, I'm erehzuwlamA! I make games, animations, and art! My dream is to be a game developer.

I can give out coding advice.
BetaBuilds
Scratcher
9 posts

Decoding FEN strings in Scratch

Hey I think I can help, but are you going to turn this into a cloud game, because if so, there are better ways to describe the position of pieces on rows/more fit for online. Also, while FEN's look to be good at describing chess pieces and easy to understand and concise for humans to understand, there might be better ways to it so it's simpler for computers to decrypt.

Last edited by BetaBuilds (April 1, 2024 22:41:06)

erehzuwlamA
Scratcher
56 posts

Decoding FEN strings in Scratch

There is also PGN's which is telling us the moves played, but I want to focus on a specific position for now. FEN and PGN are the most popular, and they sound simple, but implementing them into scratch is hard at least for me. Im not sure if there are any other ways but I will look into it. For now, I will focus on FEN as that is what most people know and websites give to the user.

when green flag clicked
say [Hello World!]

Hey, I'm erehzuwlamA! I make games, animations, and art! My dream is to be a game developer.

I can give out coding advice.
erehzuwlamA
Scratcher
56 posts

Decoding FEN strings in Scratch

And no, this isn't supposed to be a cloud game, or a game at all. I don't want to make online chess in scratch as that would take way too long and already one exists. I just want to make a tool where you can import a FEN string and maybe a PGN in the future and the project will display the correct chess position.

when green flag clicked
say [Hello World!]

Hey, I'm erehzuwlamA! I make games, animations, and art! My dream is to be a game developer.

I can give out coding advice.
BetaBuilds
Scratcher
9 posts

Decoding FEN strings in Scratch

OK, but since an FEN string is only one row long, do you want the project to have a whole chess board where you add the FEN string and it modifys the board depending on the string? Or just has a row that reflects whatever FEN you want to decrypt?

Powered by DjangoBB