Recently I uploaded my project, ScratchCAPS. In this project you type in something, and the Scratch Cat says it with all capital letters.
The only thing, is that it takes a while to do. Are there were any faster methods to make text all upper-case? After all, there isn't a caps block.
In my project, there is a list of all of the letters of the alphabet, in lower-case, and a list of all of the letters of the alphabet, in upper-case. The project looks through each letter of your entry, checking if any of them are in the lower-case list. If it is, then it sets a variable to "" (nothing), and counts up all of the letters before the lower-case letter, and adds whatever words or letters are previous to it to that variable. Then it adds the letter, from the upper-case list. Then it adds the rest of the words/letters in the entry to the variable. Finally it replaces current result with the variable. This process repeats until it has checked through all of the letters.
Feel free to look at the scripts, and edit them, while also trying different methods
Offline
Since Scratch's ask input is not case-sensitive, there's no faster way than looping through lists. Create lists: UpperCase and InputLetters. Create variable iterator.
when Green Flag clicked ask (Enter some text) set [iterator] to (1) delete (all) of [InputLetters] repeat (length of (answer)) { add (letter (iterator) of (answer)) to [InputLetters] change [iterator] by (1) }
This code breaks the input string into single characters, into InputLetters array. Now this process is quite simple. The actual changing one is more complex, but I think you've figured it out. Use each element of InputLetters. Search for it in the UpperCase list, then append to output variable. Print the output on screen (say).
Offline
filo5 wrote:
Since Scratch's ask input is not case-sensitive, there's no faster way than looping through lists. Create lists: UpperCase and InputLetters. Create variable iterator.
Code:
when Green Flag clicked ask (Enter some text) set [iterator] to (1) delete (all) of [InputLetters] repeat (length of (answer)) { add (letter (iterator) of (answer)) to [InputLetters] change [iterator] by (1) }This code breaks the input string into single characters, into InputLetters array. Now this process is quite simple. The actual changing one is more complex, but I think you've figured it out. Use each element of InputLetters. Search for it in the UpperCase list, then append to output variable. Print the output on screen (say).
Oh that makes so much more sense. I should have thought of that. Although I have to add another if block to make sure the input is a letter, it works.
Offline