Discuss Scratch

awtyagrawals
Scratcher
100+ posts

Does anyone know how to make Encoding and Decoding?

Does anyone know the script to make Encoding and Decoding?
p-p-p-p-p-p-p-p-p-p-
Scratcher
1000+ posts

Does anyone know how to make Encoding and Decoding?

Hello! The easiest way to do this is to assign each character a number and then make a few lists with the encoding and decoding.
awtyagrawals
Scratcher
100+ posts

Does anyone know how to make Encoding and Decoding?

I need the exact code
deck26
Scratcher
1000+ posts

Does anyone know how to make Encoding and Decoding?

Look at the wiki page on Global High Scores.
Hamuniii
Scratcher
57 posts

Does anyone know how to make Encoding and Decoding?

Encode:

define Encode(input)
set [msg] to ()
set [i] to (0)
repeat (length of (input))
change [i] by (1)
set [msg] to (join [msg] ((item # of (letter (i) of (input)) in [letters and numbers] :: list) + (10)))
end

Decode:

define Decode(input)
set [msg] to ()
set [i] to (-1)
repeat ((length of (input)) / (2))
change [i] by (2)
set [msg] to ((join (letter (i) of (input)) (letter ((i) + (1)) of (input))) - (10))
end

Edit: It should be written now properly and should work.

And to make a list with all letters and numbers you want:

(note:
(letters & numbers)
and
(letters and numbers :: list)
are a different thing!)

set [i] to (0)
delete (all) of [letters and numbers]
set [letters & numbers] to [abcdefghijklmnopqrstuvwxyzåäö 0123456789]
repeat (length of (letters & numbers))
change [i] by (1)
add (letter (i) of (letters & numbers)) to [letters and numbers]
end

Remember to add the letter space in the list!

Last edited by Hamuniii (Oct. 10, 2020 15:41:57)

awtyagrawals
Scratcher
100+ posts

Does anyone know how to make Encoding and Decoding?

Hamuniii wrote:

Encode:

define Encode(input)
set [msg] to ()
set [i] to (0)
repeat (length of (input))
change [i] by (1)
set [msg] to (join [msg] ((item # of (letter (i) of (input)) in [letters and numbers] :: list) + (10)))
end

Decode:

define Decode(input)
set [msg] to ()
set [i] to (-1)
repeat ((length of (input)) / (2))
change [i] by (2)
set [msg] to ((join (letter (i) of (input)) (letter ((i) + (1)) of (input))) - (10))
end

Edit: It should be written now properly and should work.

And to make a list with all letters and numbers you want:

(note:
(letters & numbers)
and
(letters and numbers :: list)
are a different thing!)

set [i] to (0)
delete (all) of [letters and numbers]
set [letters & numbers] to [abcdefghijklmnopqrstuvwxyzåäö 0123456789]
repeat (length of (letters & numbers))
change [i] by (1)
add (letter (i) of (letters & numbers)) to [letters and numbers]
end

Remember to add the letter space in the list!
Wait, shouldn't it be ########abcdefghijklmnopqrstuvwxyzåäö 0123456789
For encoding and decoding I usually see the hashtags so the decoding numbers are two digits
awtyagrawals
Scratcher
100+ posts

Does anyone know how to make Encoding and Decoding?

also it did not work

Powered by DjangoBB