Navigation

    CreatiCode Scratch Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode

    Feature request: a block to make a string backwards and other text stuff

    Feedback
    feature-request feedback suggestion
    3
    21
    1336
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • jeffreyrb03-gmail
      JaecadeJnight Mod Helper last edited by jeffreyrb03-gmail

      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:

      alt text

      * 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) ).

      #LLJW
      <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

      info-creaticode c. 2 Replies Last reply Reply Quote 3
      • info-creaticode
        CreatiCode @jeffreyrb03-gmail last edited by

        @jeffreyrb03-gmail

        Thanks for the proposals. We can definitely add these blocks, but we would like to see more upvotes before committing to them.

        jeffreyrb03-gmail 1 Reply Last reply Reply Quote 2
        • c.
          Cαƚƚყ Mod Helper @jeffreyrb03-gmail last edited by

          @jeffreyrb03-gmail
          I thought Google used %20?

          Official Forums Moderator

          jeffreyrb03-gmail 1 Reply Last reply Reply Quote 1
          • jeffreyrb03-gmail
            JaecadeJnight Mod Helper @c. last edited by

            @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.

            #LLJW
            <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

            1 Reply Last reply Reply Quote 1
            • jeffreyrb03-gmail
              JaecadeJnight Mod Helper @info-creaticode last edited by

              @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:
              fbdbc099-09fe-47fb-af3a-2d91c683f7e3-image.png

              #LLJW
              <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

              info-creaticode 1 Reply Last reply Reply Quote 1
              • info-creaticode
                CreatiCode @jeffreyrb03-gmail last edited by

                @jeffreyrb03-gmail

                Can you explain what kind of project would make use of the “cowsay” block?

                jeffreyrb03-gmail 1 Reply Last reply Reply Quote 2
                • jeffreyrb03-gmail
                  JaecadeJnight Mod Helper @info-creaticode last edited by

                  @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

                  #LLJW
                  <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

                  info-creaticode 1 Reply Last reply Reply Quote 1
                  • jeffreyrb03-gmail
                    JaecadeJnight Mod Helper last edited by

                    @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.

                    #LLJW
                    <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

                    1 Reply Last reply Reply Quote 1
                    • info-creaticode
                      CreatiCode @jeffreyrb03-gmail last edited by

                      @jeffreyrb03-gmail

                      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?

                      jeffreyrb03-gmail 2 Replies Last reply Reply Quote 2
                      • jeffreyrb03-gmail
                        JaecadeJnight Mod Helper @info-creaticode last edited by

                        @info-creaticode that is true

                        #LLJW
                        <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

                        1 Reply Last reply Reply Quote 1
                        • jeffreyrb03-gmail
                          JaecadeJnight Mod Helper @info-creaticode last edited by

                          @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

                          #LLJW
                          <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

                          info-creaticode c. 2 Replies Last reply Reply Quote 1
                          • info-creaticode
                            CreatiCode @jeffreyrb03-gmail last edited by

                            @jeffreyrb03-gmail

                            Agreed. We can put that on our list.

                            1 Reply Last reply Reply Quote 2
                            • c.
                              Cαƚƚყ Mod Helper @jeffreyrb03-gmail last edited by

                              @jeffreyrb03-gmail
                              couldn’t you just do this?
                              Screen recording 2024-10-06 21.39.32.gif

                              Official Forums Moderator

                              jeffreyrb03-gmail 1 Reply Last reply Reply Quote 1
                              • jeffreyrb03-gmail
                                JaecadeJnight Mod Helper @c. last edited by

                                @catty no, like blue to eulb, not literally

                                #LLJW
                                <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

                                c. 1 Reply Last reply Reply Quote 1
                                • c.
                                  Cαƚƚყ Mod Helper @jeffreyrb03-gmail last edited by

                                  @jeffreyrb03-gmail
                                  oh.

                                  Official Forums Moderator

                                  jeffreyrb03-gmail 1 Reply Last reply Reply Quote 1
                                  • jeffreyrb03-gmail
                                    JaecadeJnight Mod Helper @c. last edited by jeffreyrb03-gmail

                                    @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

                                    #LLJW
                                    <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

                                    c. 1 Reply Last reply Reply Quote 1
                                    • c.
                                      Cαƚƚყ Mod Helper @jeffreyrb03-gmail last edited by

                                      @jeffreyrb03-gmail
                                      I should probably start reading more carefully to not make silly mistakes… 😅

                                      Official Forums Moderator

                                      jeffreyrb03-gmail 1 Reply Last reply Reply Quote 1
                                      • jeffreyrb03-gmail
                                        JaecadeJnight Mod Helper @c. last edited by

                                        @catty lol were human it happens

                                        #LLJW
                                        <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

                                        1 Reply Last reply Reply Quote 1
                                        • c.
                                          Cαƚƚყ Mod Helper last edited by c.

                                          @catty
                                          oh wait nvm. my brain needs sleep. 🥱

                                          Official Forums Moderator

                                          jeffreyrb03-gmail 1 Reply Last reply Reply Quote 0
                                          • jeffreyrb03-gmail
                                            JaecadeJnight Mod Helper last edited by

                                            @catty this isn’t a chatroom, its still ontopic

                                            #LLJW
                                            <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

                                            1 Reply Last reply Reply Quote 1
                                            • jeffreyrb03-gmail
                                              JaecadeJnight Mod Helper @c. last edited by

                                              @catty yeah prolly lol

                                              #LLJW
                                              <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

                                              1 Reply Last reply Reply Quote 1
                                              • First post
                                                Last post