Feature request: a block to make a string backwards and other text stuff
-
A reporter block that can make text backwards (blue -> eulb) would be useful. The XO assistant works for me now so it isnāt really an issue, but I feel like itād be better and easier if this were just one reporter block, since it feels like a waste of code to make a whole for-each loop to loop through every single letter and make annoying temporary variables and all that stuff.
I know that these might not be used very often, but other blocks that can transform/encode text would be awesome, like some examples:
- ROT13 encryption: ROT13 is a simple encoding method usually used for fun and puzzles that turns every letter in a string to the 13th letter after it in the English alphabet. This picture explains it well:
* cowsay and other ASCII art things: You provide text like "Why did the chicken cross the road? (line break) To get to the other side!", and then the reporter block returns it to you in ASCII art with a cow or other options saying it in a speech or thought bubble. Examples:
Cow:
________________________________________ / Why did the chicken cross the road? \ \ To get to the other side! / ---------------------------------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || ||Tux the Linux penguin mascot:
_________________________________________ / You are only young once, but you can \ \ stay immature indefinitely. / ----------------------------------------- \ \ .--. |o_o | |:_/ | // \ \ (| | ) /'\_ _/`\ \___)=(___/And more info about it can be found here: https://en.wikipedia.org/wiki/Cowsay
- Reporter blocks to encode/convert characters for to make them suitable in URLs or specific cases: for example, take a look at https://www.google.com/search?q=creaticode+website . Because URLs canāt handle spaces, they will use a + or another character I forgot. Like when you Google ā$ā, the $ gets turned into %24 when its in the URL. Having blocks for decoding/encoding in formats like base 64 would also be useful, say if you have the user intentionally upload a ātextā file that actually isnāt text and is a .PNG image renamed to .txt and then show the user that image by showing the data URI of that image as the URL in a widget.
- Doing things with words, like finding the dictionary definition(s) of a word and returning it in a table, finding synonyms of the possible meanings of the word and returning a table (ex: ālightā would have synonyms regarding weight (portable, lightweight) and ones regarding actual light (luminosity, radiance) ).
-
Thanks for the proposals. We can definitely add these blocks, but we would like to see more upvotes before committing to them.
-
@jeffreyrb03-gmail
I thought Google used %20? -
@catty URLs also use that for a space, but plus is more common (at least for me). Itās just about making it so certain characters work with URLs, which is useful if Iām attempting to get a webpage but I need to append data to the end of its URL, and make sure that itās valid. I mean the browser does that by default, replacing special characters with their URL-encoding equivalents, but itās better to stay safe than sorry with some stuff like that.
-
@info-creaticode Thank you! Iāve also found there are more cowsays out there so if cowsay does get added, it would need an option to make your own custom ones, and like tons of others like this:

-
Can you explain what kind of project would make use of the ācowsayā block?
-
@info-creaticode Iām not sure, probably an OS project mocking a Linux terminal? I just think itād be a fun block to add and it could be displayed in a multiline widget to give fun facts or funny messages
-
@info-creaticode Cowsay is the one suggestion I made that is purely for fun, and is possible using basic Scratch blocks on its own.
However, in terms of people actually using these blocks, I think the ones for turning text backwards and getting dictionary definitions and synonyms of words will be used most and thereās potential to make good educational tutorials out of them.However the ones for encoding (URL, and Base64) would probably be less used. This is because itās more technical, however those blocks would be very useful for advanced things, mainly for the same reasons or cases that developers using other programming languages would need them. I didnāt include ROT13 because itās not all that important. Base64 is also not possible using current CreatiCode blocks, and Base64 is important because itās the only way in the browser to convert binary into just text. For example, you could have the user upload an image, convert that raw file into Base64, and now itās usable, and just append the file contents to ādata:image/png;base64,ā, and then lastly, you would show that image back to the user by putting that URL as the image parameter into a widget, and boom, now you are showing an image the user uploaded back to the user using a widget.
-
You know, we should only add blocks thatāll be widely used in many projects, so it doesnāt seem cowsay is a good candidate for that?
-
@info-creaticode that is true
-
@info-creaticode Cowsay is already more than doable using join () () and some linebreaks, so it was a bad suggestion I guess, but things like turning text backwards might be widely used
-
Agreed. We can put that on our list.
-
@jeffreyrb03-gmail
couldnāt you just do this?

-
@catty no, like blue to eulb, not literally
-
-
@catty to do that right now requires a for loop that loops through every character and puts it at the start, but thatās annoying, so I suggested that a block like (reverse text( blue)) is just added so I donāt have to do that
-
@jeffreyrb03-gmail
I should probably start reading more carefully to not make silly mistakesā¦
-
@catty lol were human it happens
-
@catty
oh wait nvm. my brain needs sleep. š„± -
@catty this isnāt a chatroom, its still ontopic
-
@catty yeah prolly lol