Discuss Scratch

CaptainPeter
Scratcher
40 posts

Why Nobody Has Made a Maxed Cloud Engine (MCE)

Maxed Cloud Engines (MCE) utilize Scratch cloud variables to the max. Setting cloud variables to the maximum length (256), this approach can have 10^256 unique values. This can encode messages (composed of 0-9, a-z, “_” , and “ ”) up to a length of 162.

Basically what the encoding does is convert base-38 (how many characters you will be encoding) into base-10 (what the cloud variables can store.)

BUT, this doesn't work because Scratch becomes less precise with bigger numbers. Even with a relatively small number, I got the wrong output.

If you find a way to fix this, please tell me.
AHypnoman
Scratcher
1000+ posts

Why Nobody Has Made a Maxed Cloud Engine (MCE)

Don't use maths operations on the cloud variable - although it can only take numbers, treat it like a string. Use join rather than multiply to add on digits, and to decode iterate over the string and read every two characters. Also offset your ‘digits’ array by 9, such that the first index with a value in the array is 10.

the while block scares me
TheCreatorOfUnTV
Scratcher
1000+ posts

Why Nobody Has Made a Maxed Cloud Engine (MCE)

AHypnoman wrote:

the while block scares me
Why? It's just this:
while <>{

} :: control
dynamicsofscratch
Scratcher
1000+ posts

Why Nobody Has Made a Maxed Cloud Engine (MCE)

TheCreatorOfUnTV wrote:

(#3)

AHypnoman wrote:

the while block scares me
Why? It's just this:
while <>{

} :: control
AAAAAAAAAAA
PoIygon
Scratcher
1000+ posts

Why Nobody Has Made a Maxed Cloud Engine (MCE)

dynamicsofscratch wrote:

(#4)

TheCreatorOfUnTV wrote:

(#3)

AHypnoman wrote:

the while block scares me
Why? It's just this:
while <>{

} :: control
AAAAAAAAAAA
AFD is gonna be funny next year when this block gets commonly used as a rickroll
ninjaMAR
Scratcher
1000+ posts

Why Nobody Has Made a Maxed Cloud Engine (MCE)

How do you end up with 10^256 unique values? Shouldn't it be 1280 characters? Assuming 256 digits per cloud variable, 10 cloud variables, and two digits per letter. My cloud list engine can support 2560 digits. (No, I'm not advertising, look at the title) (Scratch's cloud servers are very messed up, so the project hasn't been working too well recently)

Could you please share a link to your project that isn't working correctly?

Edit:
I saw your project. I don't really understand your problem, but from what I can deduce, I think that your encode/decode scripts might not work properly.

Last edited by ninjaMAR (Aug. 17, 2024 09:56:20)

CaptainPeter
Scratcher
40 posts

Why Nobody Has Made a Maxed Cloud Engine (MCE)

ninjaMAR wrote:

How do you end up with 10^256 unique values? Shouldn't it be 1280 characters? Assuming 256 digits per cloud variable, 10 cloud variables, and two digits per letter. My cloud list engine can support 2560 digits. (No, I'm not advertising, look at the title) (Scratch's cloud servers are very messed up, so the project hasn't been working too well recently)

Could you please share a link to your project that isn't working correctly?

Edit:
I saw your project. I don't really understand your problem, but from what I can deduce, I think that your encode/decode scripts might not work properly.
You don't need two digits per letter.

Using two digits per letter is simpler, but only gets you 128 characters per cloud variable. This approach can get up to 162 characters.

By the way, my project is really just converting base-38 to base-10 and base-10 to base-38. Why it looks like my scripts aren't working is because Scratch can't do precise math on numbers that are this big.
yadayadayadagoodbye
Scratcher
1000+ posts

Why Nobody Has Made a Maxed Cloud Engine (MCE)

CaptainPeter wrote:

ninjaMAR wrote:

How do you end up with 10^256 unique values? Shouldn't it be 1280 characters? Assuming 256 digits per cloud variable, 10 cloud variables, and two digits per letter. My cloud list engine can support 2560 digits. (No, I'm not advertising, look at the title) (Scratch's cloud servers are very messed up, so the project hasn't been working too well recently)

Could you please share a link to your project that isn't working correctly?

Edit:
I saw your project. I don't really understand your problem, but from what I can deduce, I think that your encode/decode scripts might not work properly.
You don't need two digits per letter.

Using two digits per letter is simpler, but only gets you 128 characters per cloud variable. This approach can get up to 162 characters.

By the way, my project is really just converting base-38 to base-10 and base-10 to base-38. Why it looks like my scripts aren't working is because Scratch can't do precise math on numbers that are this big.
You could probably write up some sort of custom math function with strings

it would be pretty annoying though
CaptainPeter
Scratcher
40 posts

Why Nobody Has Made a Maxed Cloud Engine (MCE)

yadayadayadagoodbye wrote:

CaptainPeter wrote:

ninjaMAR wrote:

How do you end up with 10^256 unique values? Shouldn't it be 1280 characters? Assuming 256 digits per cloud variable, 10 cloud variables, and two digits per letter. My cloud list engine can support 2560 digits. (No, I'm not advertising, look at the title) (Scratch's cloud servers are very messed up, so the project hasn't been working too well recently)

Could you please share a link to your project that isn't working correctly?

Edit:
I saw your project. I don't really understand your problem, but from what I can deduce, I think that your encode/decode scripts might not work properly.
You don't need two digits per letter.

Using two digits per letter is simpler, but only gets you 128 characters per cloud variable. This approach can get up to 162 characters.

By the way, my project is really just converting base-38 to base-10 and base-10 to base-38. Why it looks like my scripts aren't working is because Scratch can't do precise math on numbers that are this big.
You could probably write up some sort of custom math function with strings

it would be pretty annoying though
Yeah, I know. That's why I haven't done it. Maybe I'll try in the future though…
breakfast_for_dinner
Scratcher
1000+ posts

Why Nobody Has Made a Maxed Cloud Engine (MCE)

if i'm understanding correctly, this works to find if two numbers are exactly exactly equal:
define (1) = (2) ?
set [i v] to [0]
set [equal? v] to [yes]
repeat (length of (1 :: custom-arg))
if <not <(letter (i) of (1 :: custom-arg)) = (letter (i) of (2 :: custom-arg))>> then
set [equal? v] to [no]
end
end
CaptainPeter
Scratcher
40 posts

Why Nobody Has Made a Maxed Cloud Engine (MCE)

breakfast_for_dinner wrote:

if i'm understanding correctly, this works to find if two numbers are exactly exactly equal:
define (1) = (2) ?
set [i v] to [0]
set [equal? v] to [yes]
repeat (length of (1 :: custom-arg))
if <not <(letter (i) of (1 :: custom-arg)) = (letter (i) of (2 :: custom-arg))>> then
set [equal? v] to [no]
end
end

What?
BigNate469
Scratcher
1000+ posts

Why Nobody Has Made a Maxed Cloud Engine (MCE)

CaptainPeter wrote:

breakfast_for_dinner wrote:

if i'm understanding correctly, this works to find if two numbers are exactly exactly equal:
define (1) = (2) ?
set [i v] to [0]
set [equal? v] to [yes]
repeat (length of (1 :: custom-arg))
if <not <(letter (i) of (1 :: custom-arg)) = (letter (i) of (2 :: custom-arg))>> then
set [equal? v] to [no]
end
end

What?
It's a string-based math function.
ninjaMAR
Scratcher
1000+ posts

Why Nobody Has Made a Maxed Cloud Engine (MCE)

breakfast_for_dinner wrote:

(#10)
if i'm understanding correctly, this works to find if two numbers are exactly exactly equal:
define (1) = (2) ?
set [i v] to [0]
set [equal? v] to [yes]
repeat (length of (1 :: custom-arg))
if <not <(letter (i) of (1 :: custom-arg)) = (letter (i) of (2 :: custom-arg))>> then
set [equal? v] to [no]
end
end

I think it should be something like this
define (1) = (2)
set [i v] to [1]
set [equal? v] to [0] // falsey
if <(length of (1 :: custom-arg)) = (length of (2 :: custom-arg))> then
repeat (length of (1 :: custom-arg))
if <not <(letter (i) of (1 :: custom-arg)) = (letter (i) of (2 :: custom-arg))>> then
stop [ this script v]
end

change [i v] by (1)
end

set [ equal v] to [1] // truthy
end

Last edited by ninjaMAR (Aug. 23, 2024 12:14:29)

Maximouse
Scratcher
1000+ posts

Why Nobody Has Made a Maxed Cloud Engine (MCE)

You don't need a loop to compare two numbers as strings – the following would also work:
define (1) = (2)
set [equal? v] to <(join (1 :: custom-arg) []) = (join (2 :: custom-arg) [])>

If both are already strings (in this kind of project they should be), you can simply use the “=” operator.

Last edited by Maximouse (Aug. 23, 2024 13:55:22)

IndexErrorException
Scratcher
500+ posts

Why Nobody Has Made a Maxed Cloud Engine (MCE)

CaptainPeter wrote:

Maxed Cloud Engines (MCE) utilize Scratch cloud variables to the max. Setting cloud variables to the maximum length (256), this approach can have 10^256 unique values. This can encode messages (composed of 0-9, a-z, “_” , and “ ”) up to a length of 162.

Basically what the encoding does is convert base-38 (how many characters you will be encoding) into base-10 (what the cloud variables can store.)

BUT, this doesn't work because Scratch becomes less precise with bigger numbers. Even with a relatively small number, I got the wrong output.

If you find a way to fix this, please tell me.

This has been done by me already. I used a larger base system but it could easily be scaled down. Someone else made a much cleaner system also to convert the bases.

https://scratch.mit.edu/projects/884281710/

What I did is break it down into chunks to prevent numbers in the base conversion from cross the integer limit in Scratch, which turns them into imprecise floats. Pretty sure that value is 2^53- 1

Last edited by IndexErrorException (Aug. 24, 2024 03:23:13)

Powered by DjangoBB