Discuss Scratch

NexusSfan
Scratcher
100+ posts

Unicode blocks

Knightbot63 wrote:

nnhhaatt wrote:

Support!!!!
Why do you support? And be constructive.
First of all, what would you expect? Because it's an actual good feature?
Don't say “be constructive” to that, THOUSANDS OF PEOPLE SAY SUPPORT ALL THE TIME!!!
k7e
Scratcher
1000+ posts

Unicode blocks

NexusSfan wrote:

Knightbot63 wrote:

nnhhaatt wrote:

Support!!!!
Why do you support? And be constructive.
First of all, what would you expect? Because it's an actual good feature?
Don't say “be constructive” to that, THOUSANDS OF PEOPLE SAY SUPPORT ALL THE TIME!!!
You're supposed to be constructive and say why you support. However, making a new post that just says “please say WHY you support” is spammy and also sort of unconstructive.
TWY_
Scratcher
12 posts

Unicode blocks

Full Support

Eduational perspective
Unicode is how the computer system handles the characters that are meant to be displayed on screen nowadays. Therefore, it is definitely meaningful and educational for children to learn about this (like how textbooks describe computer processes data as bits (stream of “0 and 1”s) and characters are also represented as such.

Workaround
Currently, if one needs to handle Unicode conversion, one has to store a variable (or list) of all (at least half of, I would say) possible characters.
For the easier backward one that returns the character by its Unicode value (require all possible characters), one can simulate
chrx chr(x) in this post is defined as the character with the Unicode value of x (for simplicity, usually named chr or char in other programming languages)
by
letterxofunicode the variable "unicode" stores a string of all characters

However, the inverse is more complicated. Even if one uses
item#ofxinunicode
, the problem of case-insensibility still arises that one needs to handle thousands of exception cases.
(not only “A” to “Z”, but also “ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ”…)
(Verify by exhausting all characters against
ordchrx=x ord(x) in this post is defined as the inverse of chr, i.e. the Unicode value of x (for simplicity, usually named ord, code, or unicode in other programming languages)
)
(Notice that Scratch is designed for global users that non-English speakers have already come across these characters short after learning to write)

A time complexity issue is that the above block does not assume the list to be sorted, thus the running time is O(n) (n is the total number of characters).
A more efficient algorithm is to use binary search on the variable / list, which reduces the running time to O(log n).

Also, the suggested method to detect letter cases uses the costume block, which forces the script to refresh the screen (making the subroutine run slow or suffer from race conditions). The only known workaround is to use a similar method on the word last / random to skip the costume method for 9 of the letters.
notlengthofitemlast / randomoflist=0
Another lesser-known issue in the ASCII range is that
assertletter9ofunicode=0 Tab character equals 0

Nevertheless, a tedious custom block is currently needed to handle the conversion of such a fundamental function in a computer.

Use Cases
  • Exact string comparison / Case Sensing
    One of the most frequently requested features / most annoying issues yet unresponded in Scratch.
    If string comparison is case-insensitive, it should provide a way for users to do the exact match version.
    Introducing Unicode conversion can be a very intuitive way to demonstrate how exact string comparison works internally, even by a sample code on Wiki.
  • Line breaks
    Blocks like say / think, and variable displays support the use of line breaks to display multiline text. It is currently not easy to assign a variable to have the value of a line break character (\n) using the scratch GUI. Unicode blocks can solve this issue easily by:
    joinjoinLine 1chr10Line 2
    This character also improves the readability of output for projects with lots of interaction.
  • Text Rendering / “Fonts”
    Having a unique index for each character is extremely useful to handle the lookup of the way to draw each character.
    Current lookup methods need to handle case sensibility issues a lot.
    This can be used as a subroutine to many pure pen projects, especially when non-Latin characters are used.
    setway to drawtoitemordofpath
  • Education
    Some projects to teach viewers what Unicode is (or even other encoding methods since this can provide a unique index for lookup in another list)
  • Text Encoding / Decoding / Encryption / Decryption / Hashing
    For access control or whatever advanced purposes (it can be used in projects of tools / demonstration about these topics, at least)

Conclusion
Full Support based on it being a fundamental concept.

Last edited by TWY_ (Oct. 21, 2023 10:22:05)

NexusSfan
Scratcher
100+ posts

Unicode blocks

TWY_ wrote:

- snip -
I was thinking of something more advanced for the blocks like this:

convertsymbolatocodepointconvertsymbolbtounicodeconvertcodepoint65tosymbolconvertunicodeU+0041tosymbol
cookieclickerer33
Scratcher
1000+ posts

Unicode blocks

NexusSfan wrote:

TWY_ wrote:

- snip -
I was thinking of something more advanced for the blocks like this:

convertsymbolatocodepointconvertsymbolbtounicodeconvertcodepoint65tosymbolconvertunicodeU+0041tosymbol
The issue with this is that you first need to understand Unicode to use them

With something like the advanced math/trigonometry block you will eventually learn what those do in school
But Unicode isn’t something you will learn in school really so you can’t even make that argument

It’s better they don’t mention Unicode
chriscreators14
Scratcher
500+ posts

Unicode blocks

Randomness-TV wrote:

(#11)
No support. My main reason is that not many users know Unicode.
Not many users know trig either, yet the ST still implemented it.
BrendenL622
Scratcher
6 posts

Unicode blocks

Full Support!
-Cubism007-
Scratcher
500+ posts

Unicode blocks

Nah, very complex to 7~9 years .__.
NexusSfan
Scratcher
100+ posts

Unicode blocks

nah
-Cubism007-
Scratcher
500+ posts

Unicode blocks

Not support, bcause its very complex ._______.

Last edited by -Cubism007- (Oct. 2, 2023 14:13:10)

cookieclickerer33
Scratcher
1000+ posts

Unicode blocks

-Cubism007- wrote:

Not support, bcause its very complex ._______.
In what way is it complex
CodeMaster_TheGreat
Scratcher
25 posts

Unicode blocks

What about ASCII
-Cubism007-
Scratcher
500+ posts

Unicode blocks

cookieclickerer33 wrote:

-Cubism007- wrote:

Not support, bcause its very complex ._______.
In what way is it complex
Explain to a 5 year old how to use these blocks.
cookieclickerer33
Scratcher
1000+ posts

Unicode blocks

-Cubism007- wrote:

cookieclickerer33 wrote:

-Cubism007- wrote:

Not support, bcause its very complex ._______.
In what way is it complex
Explain to a 5 year old how to use these blocks.
Okay little Timmy this block turns whatever you put into it into a number!
The other one takes that number and turns it back into that text you had!

This doesn’t even need to be just words, it can be anything you can think of!


Literally that simple

Last edited by cookieclickerer33 (Oct. 2, 2023 14:43:30)

-Cubism007-
Scratcher
500+ posts

Unicode blocks

cookieclickerer33 wrote:

-Cubism007- wrote:

cookieclickerer33 wrote:

-Cubism007- wrote:

Not support, bcause its very complex ._______.
In what way is it complex
Explain to a 5 year old how to use these blocks.
Okay little Timmy this block turns whatever you put into it into a number!
The other one takes that number and turns it back into that text you had!

This doesn’t even need to be just words, it can be anything you can think of!


Literally that simple
I asked to ChatGPT hot to explain these blocks:

“Okay, let's imagine the characters in a computer are like toys in a big toy box. Each toy has its own special number, like a secret code. This secret code is called a ”Unicode codepoint.“ So, when the computer wants to remember a toy (character), it writes down its special code.

Now, there's another special code called ASCII, which is like a small set of toys that everyone agreed on a long time ago. It's like having a small group of favorite toys that everyone knows about.

But Unicode is like a super big toy box that can hold toys from all around the world! It has toys from different languages, special symbols, cool emojis, and even math symbols. So, when the computer wants to play with any toy, it looks at its special code, the Unicode codepoint.

Some languages the computer speaks (programming languages) have a way to talk with the toys. They can ask, ”Hey, what's the code of this toy?“ or ”Give me the toy with this code.“ But not all languages can do this.

Imagine if you asked for a toy that doesn't exist or asked for many toys at once. It's like asking for a toy that's not in the toy box or asking for too many toys to carry! In some cases, the computer might say, ”Oops, I can't find that toy,“ or ”Whoa, that's too many toys for me to handle!“

Oh, and there's one more thing. The Unicode codepoint is like a toy's secret code, and it doesn't depend on how you write it down or share it. It's like having a secret language that all computers understand, no matter how they like to talk.

So, programming languages, like Scratch or Snap!, can help you play with these toys and understand their secret codes. But some languages only know the small group of favorite toys (ASCII), while others know about the big toy box (Unicode). It's like having different ways to talk to toys, but it's all about having fun with the characters!” 7 PARAGRAPHS!!!
-Cubism007-
Scratcher
500+ posts

Unicode blocks

cookieclickerer33 wrote:

This doesn’t even need to be just words, it can be anything you can think of!
Okay, but please say some use to it without any encryption for cloud chat or some password system.
cookieclickerer33
Scratcher
1000+ posts

Unicode blocks

Yeah chat gpt isn’t understanding that it needs to be simple, the blocks wouldn’t mention Unicode even it would just be “number of text”
And “text from number” only later on would they understand it’s Unicode
-Cubism007-
Scratcher
500+ posts

Unicode blocks

cookieclickerer33 wrote:

Yeah chat gpt isn’t understanding that it needs to be simple, the blocks wouldn’t mention Unicode even it would just be “number of text”
And “text from number” only later on would they understand it’s Unicode
Ok, I'll ask Google Bard to explain this, because I think ChatgPT didn't understand much what I wanted to say;-;
-Cubism007-
Scratcher
500+ posts

Unicode blocks

-Cubism007- wrote:

cookieclickerer33 wrote:

Yeah chat gpt isn’t understanding that it needs to be simple, the blocks wouldn’t mention Unicode even it would just be “number of text”
And “text from number” only later on would they understand it’s Unicode
Ok, I'll ask Google Bard to explain this, because I think ChatgPT didn't understand much what I wanted to say;-;
Imagine that every letter, number, and symbol on your computer has a unique number associated with it. This number is called the Unicode codepoint. When your computer stores a character, it actually stores its codepoint.

Scratch is a programming language that allows children to create animations and games. However, Scratch does not have any blocks that allow you to convert between characters and numbers. This makes it difficult or impossible to do certain things, such as:

* Checking if two characters are equal, regardless of whether they are uppercase or lowercase.
* Checking if a character is an uppercase letter, lowercase letter, digit, or something else.
* Implementing a simple case converter.
* Using newlines in text without using hacked blocks.
* Encoding text as numbers for cloud list engines.

Adding two new blocks to Scratch that allow you to convert between characters and numbers would be very useful for children who are learning to program. It would allow them to do the things listed above, and more.

Here is a simple explanation that you could give to a 5-year-old child:

Imagine that every letter, number, and symbol on your computer has a secret number. This number is called the Unicode codepoint. When your computer stores a character, it actually stores its codepoint.

Scratch is a programming language that lets you make games and animations. But Scratch doesn't have any blocks that let you see or use the secret numbers of characters.

If Scratch had these blocks, you could do all sorts of cool things. You could make Scratch games that are case-sensitive, or that can understand text from different languages. You could even make Scratch games that can talk to each other over the internet.

Adding these blocks to Scratch would make it even more fun and powerful for kids who are learning to program.
-Cubism007-
Scratcher
500+ posts

Unicode blocks

Google Bard- wrote:

Adding these blocks to Scratch would make it even more fun and powerful for kids who are learning to program.
False XD

Google Bard- wrote:

* Using newlines in text without using hacked blocks.
True ngl.

Google Bard- wrote:

* Encoding text as numbers for cloud list engines.
NOOOOOOOOOOOOOOO

Google Bard- wrote:

* Implementing a simple case converter.
Very cool idea.

Google Bard- wrote:

* Checking if a character is an uppercase letter, lowercase letter, digit, or something else.
OMG THATS REALLY COOL!

Powered by DjangoBB