Discuss Scratch

0037318
Scratcher
100+ posts

How to Implement Case Sensitivity?

I created 2 blocks that can store strings into the cloud. The one that takes from the cloud works fine, but converting a string into the cloud has an error. The reason is, I have a list of all the possible characters, and the capital letters are being registered as the same thing as the lowercase letters. In my algorithm, that is a problem, because it means that each letter of the string is decoded twice. Once for the capital letter, and once for the lowercase letter. Is there any way to make sure that the strings are case sensitive?

Blocks Scratch are missing

<string [thing to test for v] includes [thing to search for]?::operators>
if <condition 1::operators> then {
...
} else if <condition 2::operators> then {
...
} else {
...
}::control
return [thing to return]::custom-arg cap
<[] \<= []::operators>
<[] \>= []::operators>
create instance of [thing to make copy of v] with values [1] [10] [-20]::control
(get value [value to get v] of [sprite to get from v]::sensing)
execute based on text [code to execute]::control
break::control cap
continue::control cap
store cookie [name of cookie] [value]::variables
(get cookie [name of cookie]::variables)
(replace [item to look for] with [item to replace with] in [string to do this for]::operators)
(amount of times [item to look for] shows up in [string to do this for]::operators)

And finally, text code.
asivi
Scratcher
1000+ posts

How to Implement Case Sensitivity?

0037318
Scratcher
100+ posts

How to Implement Case Sensitivity?

I do not want to detect what case something is. I want to differentiate between uppercase and lowercase letters.

Blocks Scratch are missing

<string [thing to test for v] includes [thing to search for]?::operators>
if <condition 1::operators> then {
...
} else if <condition 2::operators> then {
...
} else {
...
}::control
return [thing to return]::custom-arg cap
<[] \<= []::operators>
<[] \>= []::operators>
create instance of [thing to make copy of v] with values [1] [10] [-20]::control
(get value [value to get v] of [sprite to get from v]::sensing)
execute based on text [code to execute]::control
break::control cap
continue::control cap
store cookie [name of cookie] [value]::variables
(get cookie [name of cookie]::variables)
(replace [item to look for] with [item to replace with] in [string to do this for]::operators)
(amount of times [item to look for] shows up in [string to do this for]::operators)

And finally, text code.
asivi
Scratcher
1000+ posts

How to Implement Case Sensitivity?

0037318 wrote:

I do not want to detect what case something is. I want to differentiate between uppercase and lowercase letters.

OK
deck26
Scratcher
1000+ posts

How to Implement Case Sensitivity?

0037318 wrote:

I do not want to detect what case something is. I want to differentiate between uppercase and lowercase letters.
Which you can only do by identifying what case a letter is!
0037318
Scratcher
100+ posts

How to Implement Case Sensitivity?

Fine. I guess this will work.

Blocks Scratch are missing

<string [thing to test for v] includes [thing to search for]?::operators>
if <condition 1::operators> then {
...
} else if <condition 2::operators> then {
...
} else {
...
}::control
return [thing to return]::custom-arg cap
<[] \<= []::operators>
<[] \>= []::operators>
create instance of [thing to make copy of v] with values [1] [10] [-20]::control
(get value [value to get v] of [sprite to get from v]::sensing)
execute based on text [code to execute]::control
break::control cap
continue::control cap
store cookie [name of cookie] [value]::variables
(get cookie [name of cookie]::variables)
(replace [item to look for] with [item to replace with] in [string to do this for]::operators)
(amount of times [item to look for] shows up in [string to do this for]::operators)

And finally, text code.

Powered by DjangoBB