Discuss Scratch

91108293
Scratcher
80 posts

How do I get the Last Letter of a Variable?

I have a project that needs the last letter of the answer, no matter how long the answer is. Here's how it works: The game would ask the player a question, and the answer it recieved would be set to a variable. Certain things would change to certain costumes depending on the first letter of the variable, and certain things would change to other costumes depending on the last letter of the variable. What should I do?
Despicable_Dad
Scratcher
500+ posts

How do I get the Last Letter of a Variable?

set [last letter v] to (letter (length of (original)) of (original))
91108293
Scratcher
80 posts

How do I get the Last Letter of a Variable?

Thank you!
kommuria32
Scratcher
8 posts

How do I get the Last Letter of a Variable?

thanks
play sound [ thanks]

Last edited by kommuria32 (April 15, 2025 21:30:00)

ninjacat28_
Scratcher
100+ posts

How do I get the Last Letter of a Variable?

91108293 wrote:

I have a project that needs the last letter of the answer, no matter how long the answer is. Here's how it works: The game would ask the player a question, and the answer it recieved would be set to a variable. Certain things would change to certain costumes depending on the first letter of the variable, and certain things would change to other costumes depending on the last letter of the variable. What should I do?

set [needed v] to (letter (length of [(original)]) of [(original)])

Last edited by ninjacat28_ (April 21, 2025 11:43:07)

Powered by DjangoBB