Discuss Scratch
- medians
-
1000+ posts
Case Sensitivity Options
Bringing this topic up, though I feel like there could be a case sensitive block too, like this:


Last edited by medians (May 15, 2024 21:07:59)
- banana439monkey
-
1000+ posts
Case Sensitivity Options
this is gonna be fun!
it's not just case sensitivity but types overall!
i know that scratch cares about types even less than negligent javascript but types would still be cool
so here's the thing:
so it all depends here, but it would be nice to also have:
wait but now we have all kinds of carnage because scratch is not set up for this…
Banana
it's not just case sensitivity but types overall!
i know that scratch cares about types even less than negligent javascript but types would still be cool
so here's the thing:
console.log("1" == 1) // This returns true, they're the same value, regardless of their type console.log("abc" == "ABC") // These are different, since different cases console.log("abc" == "ABC".toLowerCase()) // This converts ABC to lowercase and hence returns true console.log("1" === 1) // "1" and 1 are the same value but different types ("1" is a string, a piece of text, while 1 is a number, and so this returns false // But now it becomes funky because... console.log(true == 1) // This returns true... // And fun fact console.log({} == {}) // Returns false because referring to an object actually refers to its pointer in memory, rather than the object itself
<[1] strictly = [1] :: operators>to strictly check for types too
wait but now we have all kinds of carnage because scratch is not set up for this…
Banana
- eoeoeoeoeoeoeoeoe
-
100+ posts
Case Sensitivity Options
What is a good workaround for “item # of ()” block since it is not case-sensitive?
- medians
-
1000+ posts
Case Sensitivity Options
If you mean the index block that was added in 3.0, you can do this for a workaround: What is a good workaround for “item # of ()” block since it is not case-sensitive?
define item # of (string1) in listThe contains part is to make sure that the result var is 0
set [result v] to [0] //keep track of the item in the list
if <[list v] contains (string1)> then
repeat until <(item (result) of [list v]) = (string1)>
change [result v] by (1)
end
end
However, the contains list block is case insensitive in Scratch 2.0 and later, and the equals block is case insensitive too, so you can use something like this (the following works because of the fact that costumes are case sensitive):
https://scratch.mit.edu/projects/10213040/
Last edited by medians (July 1, 2024 02:01:19)
- BigNate469
-
1000+ posts
Case Sensitivity Options
The only issue I see with this is that the settings icon on the block would be really hard for people on tablets to tap, due to its size. I think what @medians suggested, with a
set case sensitivity to [case sensitive v] :: operators stackwould work better. It would also allow you to change case-sensitivity modes programmatically.
- eoeoeoeoeoeoeoeoe
-
100+ posts
Case Sensitivity Options
Thanks for the advice, but I already implemented it as soon as I commented on this because of Scratch Wiki research. I have expanded case sensitive equality to whole words containing any character too to help me.If you mean the index block that was added in 3.0, you can do this for a workaround: What is a good workaround for “item # of ()” block since it is not case-sensitive?define item # of (string1) in listThe contains part is to make sure that the result var is 0
set [result v] to [0] //keep track of the item in the list
if <[list v] contains (string1)> then
repeat until <(item (result) of [list v]) = (string1)>
change [result v] by (1)
end
end
However, the contains list block is case insensitive in Scratch 2.0 and later, and the equals block is case insensitive too, so you can use something like this (the following works because of the fact that costumes are case sensitive):
https://scratch.mit.edu/projects/10213040/
- jmdzti_0-0
-
1000+ posts
Case Sensitivity Options
Last edited by jmdzti_0-0 (July 3, 2024 18:02:17)
- medians
-
1000+ posts
Case Sensitivity Options
This has already been suggested (Dupe)You created that 4 years after this topic though
Edit: I meant to type 5
Last edited by medians (July 3, 2024 13:21:26)
- jmdzti_0-0
-
1000+ posts
Case Sensitivity Options
Ah, why isn’t the op date in the post table ;-;This has already been suggested (Dupe)You created that 4 years after this topic though
Edit: I meant to type 5
- HighlaneGamingStudio
-
100+ posts
Case Sensitivity Options
I'm trying to make CVEDS (Cloud Variable Encoding/Decoding System) and I made the whole program, thinking that it was case-sensitive, only to find out that it wasn't. When I typed in Hello world! it gave me hHeElLoO wWoOrRlLdD! I think that
Edit: The turbo mode block is off topic, discuss it here. Since I first made this post, I have made a version of CVEDS that is way more efficient than the one referenced here that uses the costume workaround. I also have different ideas about the case sensitivity block now, see below.
set case sensitivity to [case-sensitive v]::sensingshould be added, along with
turbo mode [on v]::control
Edit: The turbo mode block is off topic, discuss it here. Since I first made this post, I have made a version of CVEDS that is way more efficient than the one referenced here that uses the costume workaround. I also have different ideas about the case sensitivity block now, see below.
Last edited by HighlaneGamingStudio (Jan. 17, 2025 03:01:32)
- medians
-
1000+ posts
Case Sensitivity Options
Separate suggestions should go in separate topics. I'm trying to make CVEDS (Cloud Variable Encoding/Decoding System) and I made the whole program, thinking that it was case-sensitive, only to find out that it wasn't. When I typed in Hello world! it gave me hHeElLoO wWoOrRlLdD! I think thatset case sensitivity to [case-sensitive v]::sensingshould be added, along withturbo mode [on v]::control
The first one was suggested earlier, while the other one has been suggested here:
https://scratch.mit.edu/discuss/post/933/
- blubby4
-
100+ posts
Case Sensitivity Options
I suppose the minimum implementation for this suggestion would just be
<[] is capital? :: operators>it would return true if every character is capital.
- CaptainPeter
-
40 posts
Case Sensitivity Options
Maybe something like this?
Regular equals (true):
Strict equals (false):
Regular equals (true):
<[a] [= v] [A]>
Strict equals (false):
<[a] [== v] [A]>
- endyourenite
-
100+ posts
Case Sensitivity Options
That's basically not equals, and we don't need it because we can do this: Strict equals (false):<[a] [== v] [A]>
<not <[] = []>>
- HighlaneGamingStudio
-
100+ posts
Case Sensitivity Options
Point taken. Separate suggestions should go in separate topics.
The first one was suggested earlier, while the other one has been suggested here:
https://scratch.mit.edu/discuss/post/933/
Last edited by HighlaneGamingStudio (May 18, 2025 02:44:41)
- HighlaneGamingStudio
-
100+ posts
Case Sensitivity Options
I have some other ideas, in order from best to worst. I'm trying to make CVEDS (Cloud Variable Encoding/Decoding System) and I made the whole program, thinking that it was case-sensitive, only to find out that it wasn't. When I typed in Hello world! it gave me hHeElLoO wWoOrRlLdD! I think thatset case sensitivity to [case-sensitive v]::sensingshould be added.
- An option in custom blocks, similar to run without screen refresh option, to make the contents of the block run scripts case-sensitively.
- An option in the edit section of the menu bar in the editor, similar to turbo mode, to toggle case sensitivity for the entire project.
- An option to make specific sprites case-sensitive.
I am a fan of the is exactly blocks, but these ideas are worth considering, too.