Discuss Scratch
- ev3coolexit987654
-
Scratcher
1000+ posts
Unicode blocks
Could a Scratch list hold the number of characters in a Unicode set?I don't think so. In the newest version of unicode, there are over 128,000 characters
- stickfiregames
-
Scratcher
1000+ posts
Unicode blocks
A Scratch list can hold that many, although you sometimes get issues with saving. If walkcycle is suggesting lists could be used as a workaround, that would be hopelessly inefficient.Could a Scratch list hold the number of characters in a Unicode set?I don't think so. In the newest version of unicode, there are over 128,000 characters
- gdpr533f604550b2f20900645890
-
Scratcher
1000+ posts
Unicode blocks
Why would it be hopelessly inefficient?Characters are represented in the computer's memory as numbers, so converting them would be a simple operation. However, searching a list for a character would take linear time.
- walkcycle
-
Scratcher
500+ posts
Unicode blocks
How would your premises lead to hopeless inefficiency?
Would a programmer not be able to optimize?
Would a programmer not be able to optimize?
- stickfiregames
-
Scratcher
1000+ posts
Unicode blocks
How would your premises lead to hopeless inefficiency?They can't make Scratch, which is interpreted and so not particularly fast, run any faster. Having to loop through a list, even if you used a more efficient search than a linear one, would still be very slow if you were using it for large amounts of text.
Would a programmer not be able to optimize?
- BookOwl
-
Scratcher
1000+ posts
Unicode blocks
Why would it be hopelessly inefficient?Because looking up a character in a sorted list is O(log n) time, while using a unicode block directly would be O(1), plus you would have to store this giant list in a Scratch list which makes the Scratch editor slow down by a ton, plus you have to properly handle case for each of the 1,114,112 characters and symbols.
- gdpr533f604550b2f20900645890
-
Scratcher
1000+ posts
Unicode blocks
Oh wow, I didn't realize that you could compare characters. The comparisons seem to ignore case, though.Why would it be hopelessly inefficient?Because looking up a character in a sorted list is O(log n) time, while using a unicode block directly would be O(1), plus you would have to store this giant list in a Scratch list which makes the Scratch editor slow down by a ton, plus you have to properly handle case for each of the 1,114,112 characters and symbols.
- joefarebrother
-
Scratcher
500+ posts
Unicode blocks
Unicode has 2^16 * 17 possible codepoints, which is 1,114,112. Not all those are assigned a valid character, but if you wanted to make codepoint->character constant time, you'd need a list with that many elements. I once tried to store a list with that many elements, but the project could not be saved in online mode, which meant it was impossible to open since it tried to autosave which crashed, which meant I couldn't upload a new version to fix a bug, since that required opening it.
- stickfiregames
-
Scratcher
1000+ posts
Unicode blocks
Unicode has 2^16 * 17 possible codepoints, which is 1,114,112. Not all those are assigned a valid character, but if you wanted to make codepoint->character constant time, you'd need a list with that many elements. I once tried to store a list with that many elements, but the project could not be saved in online mode, which meant it was impossible to open since it tried to autosave which crashed, which meant I couldn't upload a new version to fix a bug, since that required opening it.You could do it with two lists, one with the valid codepoints and one with the valid characters, but then it would be slow to convert both ways instead of just from character to codepoint.
- Sheep_maker
-
Scratcher
1000+ posts
Unicode blocks
JavaScript natively supports converting between a character code and the character itself:
I feel this would probably belong better in an “technical utilities” extension of some sort, though
String.fromCharCode(200) // È 'ſ'.charCodeAt() // 383
- D-ScratchNinja
-
Scratcher
1000+ posts
Unicode blocks
I agree with @Sheep_Maker. Partial support because it would be a complicated aspect for an educational website.
- -ShadowOfTheFuture-
-
Scratcher
1000+ posts
Unicode blocks
Support - this could be very useful.
… not everyone knows Unicode…Not everyone knows trigonometry. Not everyone knows how musical notes work. Not everyone knows what “() mod ()” means.
Last edited by -ShadowOfTheFuture- (Aug. 10, 2019 01:21:20)
- startreknerd
-
Scratcher
3 posts
Unicode blocks
Support - this could be very useful.Good point.… not everyone knows Unicode…Not everyone knows trigonometry. Not everyone knows how musical notes work. Not everyone knows what() mod ()means.
Last edited by startreknerd (Aug. 11, 2019 01:18:43)
- JackK211424
-
Scratcher
500+ posts
Unicode blocks
scratch is meant to be a simple programming language for Beginners in programming, and its also meant to be educational… (scratch.mit.edu)
I bet that almost no beginner in programming knows about unicode, so no support there
and it would not benefit to educational value…
but I do think that it might? be useful?
I say that very loosely…
No support
I bet that almost no beginner in programming knows about unicode, so no support there
and it would not benefit to educational value…
but I do think that it might? be useful?
I say that very loosely…
No support
Last edited by JackK211424 (Aug. 11, 2019 07:10:13)
- dogeiscut
-
Scratcher
500+ posts
Unicode blocks
scratch is meant to be a simple programming language for Beginners in programming, and its also meant to be educational… (scratch.mit.edu)bruh, look at the first page that counters this argument
I bet that almost no beginner in programming knows about unicode, so no support there
and it would not benefit to educational value…
but I do think that it might? be useful?
I say that very loosely…
No support












