Post Information

griefercube wrote in Official [scratchblocks] Testing Topic 3 at 11:09:56 AM 15/9/2020
The best way(and easiest) to make cloud encoder/decoder
define If cloud contains (_)
set [charlist v] to [ABCDEFGHIJKLMNOPQRSTUVWXYZ.!? 1234567890-_]
set [repeat v] to [0]
set [output v] to []
set [answer v] to []
repeat (length of (_::custom)::operators)
set [repeat2 v] to [0]
change [repeat v] by (1)
repeat until <(letter (repeat2) of (charlist)) = (letter (repeat) of (_::custom))>
change [repeat2 v] by (1)
end
set [output v] to (join (output) ((repeat2) + (9)))
set [answer v] to (join (answer::variables) ((repeat2) + (9)))
end
set [output v] to <(☁ cooud) contains (output)?::operators>
set [answer v] to <(☁ cloud 2) contains (answer::variables)?::operators>

when I receive [Reset v]
set [☁ A v] to [0]
set [☁ B v] to [0]
set [☁ cloud 2 v] to [0]
set [☁ cooud v] to [0]

when @greenFlag clicked
If cloud contains (username)::custom
if <<(output) = [false]> and <(answer::variables) = [false]>> then
ask [What do you vote? A/B] and wait
if <not <<(answer) = [A]> or <(answer) = [B]>>> then
say [Please answer again and click the green flag] for (2) seconds
else
if <(answer) = [A]> then
change [☁ A v] by (1)
end
if <(answer) = [B]> then
change [☁ B v] by (1)
end
Add (username) To cloud::custom
end
else
say [Sorry, you have voted]
end

define Add (String) To cloud
set [charlist v] to [ABCDEFGHIJKLMNOPQRSTUVWXYZ.!? 1234567890-_]
set [Uh, save cloud change v] to []
set [repeat v] to [0]
repeat (length of (String::custom)::operators)
set [repeat2 v] to [0]
change [repeat v] by (1)
repeat until <(letter (repeat2) of (charlist)) = (letter (repeat) of (String::custom))>
change [repeat2 v] by (1)
end
set [Uh, save cloud change v] to (join (Uh, save cloud change) ((repeat2) + (9)))
end
if <(☁ next cloud count) = [0]> then
set [☁ cooud v] to (Uh, save cloud change)
else
set [☁ cloud 2 v] to (Uh, save cloud change)
end
if <(☁ next cloud count) > [1]> then
set [☁ next cloud count v] to [0]
end
change [☁ next cloud count v] by (1)
set [Uh, save cloud change v] to [0]
Permanent Link
https://forums.scratchstats.com/post/4419381

Extra Post Information

Forum Post4419381
Post ID4419381
Time Indexed11:11:57 AM 15/9/2020
Topic ID438916
CategoryHelp With Scripts
Request Time3 ms