Discuss Scratch
- davidtheplatform
-
Scratcher
500+ posts
Online Cloud Variable
There’s a “join () ()” block:I would also like to associate a rank with specific usernames though, and allow other people to see it.(#17)Interesting! Do you have a Proof-Of-Concept?
There's roughly 65 characters you can use in a username, so if we encode them properly we only need 1.8 digits per character. Some letters are more/less common, ie. “Q” is probably used less than “e”. We can use huffman coding (or something similar) to get a little bit more compression. Normal english text can be compressed by about 8x for reference.
Various other methods could be used, like truncating usernames to 5 characters, but then you'd have to deal with collisions.(#11)I updated the project to include an API that you can use. Directions are in the editor.
https://scratch.mit.edu/projects/495545839/
Is there a way on Scratch like in Python to add onto the username such as: +“Rank = Bronze”
(join [hello ] [world])
- Ghxstify2009
-
Scratcher
100+ posts
Online Cloud Variable
So if I'm using cloud variables like everyone is saying I use
(join (☁ username) [Bronze])
- ninjaMAR
-
Scratcher
1000+ posts
Online Cloud Variable
(#22)You probably want to include a delimiter, so you know what is the username, and what is the rank. To make this more space efficient, store the rank as a number
So if I'm using cloud variables like everyone is saying I use(join (☁ username) [Bronze])
(join (join (username) [,]) [1])
- Ghxstify2009
-
Scratcher
100+ posts
Online Cloud Variable
But then how will others see their ranks?(#22)You probably want to include a delimiter, so you know what is the username, and what is the rank. To make this more space efficient, store the rank as a number
So if I'm using cloud variables like everyone is saying I use(join (☁ username) [Bronze])(join (join (username) [,]) [1])
- ninjaMAR
-
Scratcher
1000+ posts
Online Cloud Variable
(#24)Since you don't have much experience doing this, I recommend using an existing implementation of a cloud list. For each item of the list, store the username + a delimiter (can't be “:” if you use my implementation) + the rank. Then do something like the followingBut then how will others see their ranks?(#22)You probably want to include a delimiter, so you know what is the username, and what is the rank. To make this more space efficient, store the rank as a number
So if I'm using cloud variables like everyone is saying I use(join (☁ username) [Bronze])(join (join (username) [,]) [1])
set [buffer v] to []Assuming word is “ninjamar:bronze”, output will be
set [i v] to [1]
repeat (length of (word))
if <<(letter (i) of (word)) = [;]> or <(letter (i) of (word)) = []>> then
add (buffer) to [output v]
else
set [buffer v] to (join (buffer) (letter (i) of (word)))
end
change [i v] by (0)
end
OR you could ignore the cloud lists, and just use cloud variables with the same method described above
If you want, I could make a demonstration
Last edited by ninjaMAR (May 8, 2024 13:33:21)
- Ghxstify2009
-
Scratcher
100+ posts
Online Cloud Variable
If you don't mind making a demo that'd be great, because I don't follow you reading your comment(#24)Since you don't have much experience doing this, I recommend using an existing implementation of a cloud list. For each item of the list, store the username + a delimiter (can't be “:” if you use my implementation) + the rank. Then do something like the followingBut then how will others see their ranks?(#22)You probably want to include a delimiter, so you know what is the username, and what is the rank. To make this more space efficient, store the rank as a number
So if I'm using cloud variables like everyone is saying I use(join (☁ username) [Bronze])(join (join (username) [,]) [1])set [buffer v] to []Assuming word is “ninjamar:bronze”, output will be
set [i v] to [1]
repeat (length of (word))
if <<(letter (i) of (word)) = [;]> or <(letter (i) of (word)) = []>> then
add (buffer) to [output v]
else
set [buffer v] to (join (buffer) (letter (i) of (word)))
end
change [i v] by (0)
end
OR you could ignore the cloud lists, and just use cloud variables with the same method described above
If you want, I could make a demonstration
- ninjaMAR_alt
-
Scratcher
14 posts
Online Cloud Variable
(#26)https://scratch.mit.edu/projects/1016092363/If you don't mind making a demo that'd be great, because I don't follow you reading your comment(#24)Since you don't have much experience doing this, I recommend using an existing implementation of a cloud list. For each item of the list, store the username + a delimiter (can't be “:” if you use my implementation) + the rank. Then do something like the followingBut then how will others see their ranks?(#22)You probably want to include a delimiter, so you know what is the username, and what is the rank. To make this more space efficient, store the rank as a number
So if I'm using cloud variables like everyone is saying I use(join (☁ username) [Bronze])(join (join (username) [,]) [1])set [buffer v] to []Assuming word is “ninjamar:bronze”, output will be
set [i v] to [1]
repeat (length of (word))
if <<(letter (i) of (word)) = [;]> or <(letter (i) of (word)) = []>> then
add (buffer) to [output v]
else
set [buffer v] to (join (buffer) (letter (i) of (word)))
end
change [i v] by (0)
end
OR you could ignore the cloud lists, and just use cloud variables with the same method described above
If you want, I could make a demonstration
- heitorBrazillindo
-
Scratcher
12 posts
Online Cloud Variable
EasyDB is great for that!lol and what you put in the define block and the name of all cloud variables needed
define
(join [idk] [])
- heitorBrazillindo
-
Scratcher
12 posts
Online Cloud Variable
when green flag clicked
say [idk] for (2) secs
- heitorBrazillindo
-
Scratcher
12 posts
Online Cloud Variable
when green flag clicked
say [i dont know...........] for (2) secs
- Goldking9
-
Scratcher
67 posts
Online Cloud Variable
How do I create an online library full of usernames and corresponding ‘ranks’? I want to do this so that I can keep track of my members and associate a rank with their username, so that when they enter their username in a rank tracker project they will be able to see their rankUse my Intelligent Storage project which senses a lot! I added status or rank (I named it rank).
Then use
when this sprite clicked
ask [Username?] and wait
say (join [Username:] [(yourrank v)])for (2) secs
Last edited by Goldking9 (Oct. 19, 2025 21:39:13)
- retro2D
-
Scratcher
20 posts
Online Cloud Variable
Please don't post on old topics, as OP is likely no logger interested in the topic anymore.





