Discuss Scratch

mybearworld
Scratcher
1000+ posts

base1114112

(because base65536 wasn't enough)
You can download this at:
data:text/html;base64,PCFET0NUWVBFIGh0bWw+PGh0bWw+PGhlYWQ+PHRpdGxlPkRvd25sb2FkIGJhc2UxMTE0MTEyPC90aXRsZT48bWV0YSBjaGFyc2V0PSJ1dGYtOCI+PC9oZWFkPjxib2R5PjxoMj5QbGVhc2Ugd2FpdCwgZmlsZSBzaG91bGQgZG93bmxvYWQuLi48L2gyPjxhIGlkPSJkIiBzdHlsZT0iZGlzcGxheTogbm9uZSIgaHJlZiBkb3dubG9hZD0iYmFzZTExMTQxMTIucHkiPjwvYT48L2JvZHk+PHNjcmlwdD5mZXRjaCgiaHR0cHM6Ly9zY3JhdGNoLm1pdC5lZHUvZGlzY3Vzcy9wb3N0LzYyNTMzMjcvc291cmNlLyIpLnRoZW4ociA9PiByLnRleHQoKSkudGhlbih0ID0+IGVuY29kZVVSSUNvbXBvbmVudCh0KSkudGhlbihjID0+IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoIiNkIikuc2V0QXR0cmlidXRlKCJocmVmIiwgImRhdGE6dGV4dC9wbGFpbjtjaGFyc2V0PXV0Zi04LCIgKyBjKSkudGhlbihfID0+IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoIiNkIikuY2xpY2soKSk7PC9zY3JpcHQ+PC9odG1sPg==
Just paste that into your url bar.
If you don't trust that, the code is fetched from https://scratch.mit.edu/discuss/post/6253327/source/, so just copy and paste off that.

1269942946983461973250453796579517762403783755798024946091906815219733682803270183704927291217905600194048792867189627449591112161277555059714570182344956075574445088697649094264405352355526606889
This is the slogan but in decimal! A googol is:
'ۮ\U000cd50a\U00099c61\U0009664f\U000def10\U0003806a\U000c9ad9\U000125f6\U0008a474\U00067d3c\U000ef8bd\U0006d49f\U000a4f5e\U000f4630렿\U000d3c3c\U00040000'
0006ee 0cd50a 099c61 09664f 0def10 03806a 0c9ad9 0125f6 08a474 067d3c 0ef8bd 06d49f 0a4f5e 0f4630 00b83f 0d3c3c 040000

Last edited by mybearworld (June 9, 2022 09:23:42)


2+2*5 = ?
2+2*5 = 20
2+2*5 = 12
2+2*5 = 77034585053198940266692661
-EmeraldThunder-
Scratcher
1000+ posts

base1114112

Cool! You should publish this as a library on PyPI.
kccuber
Scratcher
1000+ posts

base1114112

How slow does it run?


Made using Nord Theme & Inkscape
Chiroyce
Scratcher
1000+ posts

base1114112

kccuber wrote:

How slow does it run?
Depends, I tried to encode the number 0123456789341894348234 and it encoded it instantly

Last edited by Chiroyce (April 29, 2022 04:17:58)








April Fools' topics:
New Buildings in Scratch's headquarters
Give every Scratcher an M1 MacBook Air
Scratch should let users edit other Scratchers' projects
Make a statue for Jeffalo
Scratch Tech Tips™
Make a Chiroyce statue emoji


<img src=“x” onerror=“alert('XSS vulnerability discovered')”>

this is a test sentence
PoIygon
Scratcher
1000+ posts

base1114112

Chiroyce wrote:

kccuber wrote:

How slow does it run?
Depends, I tried to encode the number 0123456789341894348234 and it encoded it instantly
i did 1234567890 and i got

Last edited by PoIygon (April 29, 2022 04:20:59)


mybearworld
Scratcher
1000+ posts

base1114112

kccuber wrote:

How slow does it run?
1~1.5 seconds before running because it has to generate all the characters. Decoding and encoding is almost instant.

2634688917799017600245374275698865162395288115887690260802356514552748205787459092025144889048938830930278271286348813957988626794616807759190105490299208798615025596353153158811434567306416873369218494575540388257199883653521203925161721325234343801442194581570037351578371219322633342694227995743787798198535006199444619368351669082537506335275277989599380577753582422433442871442102057512461243178013468853764779233345291902743937121006046958206740643576135348182418693388985601578316492991684226613287716199072080465215015494756067957799149381622657709257950664793149905526253607768976167469927803849467590488547816074017114999798503301199717023185813572292425012854702371495334645586265836336959341373159947931846948553237365344051490251147279999833987621293615514965144244907510051597344872307971290735731403724692839057958508935932213000881667811483128140751593545669083769548195740433899660259437753170125410396836593323452998345971023426414718737794203694

2+2*5 = ?
2+2*5 = 20
2+2*5 = 12
2+2*5 = 77034585053198940266692661
mybearworld
Scratcher
1000+ posts

base1114112

PoIygon wrote:

(#5)
i did 1234567890 and i got

47 0fb301 04ac18 01d0f4 05c64f 02f4b1

Last edited by mybearworld (April 29, 2022 04:56:41)


2+2*5 = ?
2+2*5 = 20
2+2*5 = 12
2+2*5 = 77034585053198940266692661
mybearworld
Scratcher
1000+ posts

base1114112

-EmeraldThunder- wrote:

(#2)
Cool! You should publish this as a library on PyPI.
Maybe

Last edited by mybearworld (April 29, 2022 15:28:56)


2+2*5 = ?
2+2*5 = 20
2+2*5 = 12
2+2*5 = 77034585053198940266692661
mybearworld
Scratcher
1000+ posts

base1114112

import sys


def decode(number):
result = 0
j = 1
for i in number:
result += chr(i)*j
j *= 1114112
return result


# from https://stackoverflow.com/questions/2267362/how-to-convert-an-integer-to-a-string-in-any-base#answer-28666223
def encode(number):
if number == 0:
return
digits =
while number:
digits.append(int(number % 1114112))
number //= 1114112
return “”.join(list(map(lambda x: chr(x), digits)))


def main():
print(“Note: When decoding, to stop, press new line and then CTRL+D (or, on Windows, CTRL+Z).\n”)

while True:
if input("ncode or ecode? “).lower() == ”e“:
encoded = encode(int(input()))

# Surrogates
surrogate = ”"
for i in encoded:
if not ord(i) in range(0xd800, 0xdfff):
surrogate += i
if encoded != surrogate:
toOutput = surrogate
print(surrogate)
else:
toOutput = encoded
print(encoded)

# Hex
for i in encoded:
h = hex(ord(i))
print((6-len(h))*“0”+h, end=“ ”)

# As ASCII
print(f“\n{toOutput !a}”)
if encoded != surrogate:
print(“WARNING: Output contains surrgoates. They have been removed for printability, but they are still included in the hex.”)
print()

else:
read = sys.stdin.read()
print(decode(read))
print(“\n”)


if __name__ == “__main__”:
main()

Last edited by mybearworld (June 26, 2022 10:37:52)


2+2*5 = ?
2+2*5 = 20
2+2*5 = 12
2+2*5 = 77034585053198940266692661
mybearworld
Scratcher
1000+ posts

base1114112


2+2*5 = ?
2+2*5 = 20
2+2*5 = 12
2+2*5 = 77034585053198940266692661
NFlex23
Scratcher
1000+ posts

base1114112

Hmm, doesn't work for me.
SyntaxError: Non-UTF-8 code starting with '\xff' in file C:\Users\~snip~\Documents\base1114112.py on line 2, but no encoding declared; see https://python.org/dev/peps/pep-0263/ for details
I'm using Python 3.10.4.

Last edited by NFlex23 (April 29, 2022 19:20:36)

mybearworld
Scratcher
1000+ posts

base1114112

NFlex23 wrote:

(#11)
Hmm, doesn't work for me.
SyntaxError: Non-UTF-8 code starting with '\xff' in file C:\Users\~snip~\Documents\base1114112.py on line 2, but no encoding declared; see https://python.org/dev/peps/pep-0263/ for details
I'm using Python 3.10.4.
That link seems to talk about python 2, are you sure you didn't accidentally run this with python 2?

2+2*5 = ?
2+2*5 = 20
2+2*5 = 12
2+2*5 = 77034585053198940266692661
NFlex23
Scratcher
1000+ posts

base1114112

mybearworld wrote:

(#12)

NFlex23 wrote:

(#11)
Hmm, doesn't work for me.
SyntaxError: Non-UTF-8 code starting with '\xff' in file C:\Users\~snip~\Documents\base1114112.py on line 2, but no encoding declared; see https://python.org/dev/peps/pep-0263/ for details
I'm using Python 3.10.4.
That link seems to talk about python 2, are you sure you didn't accidentally run this with python 2?
Yes, I'm sure; I don't even have Python 2 installed. What Python version did you use to run it?

Last edited by NFlex23 (April 29, 2022 19:34:31)

mybearworld
Scratcher
1000+ posts

base1114112

NFlex23 wrote:

(#13)

mybearworld wrote:

(#12)

NFlex23 wrote:

(#11)
Hmm, doesn't work for me.
SyntaxError: Non-UTF-8 code starting with '\xff' in file C:\Users\~snip~\Documents\base1114112.py on line 2, but no encoding declared; see https://python.org/dev/peps/pep-0263/ for details
I'm using Python 3.10.4.
That link seems to talk about python 2, are you sure you didn't accidentally run this with python 2?
Yes, I'm sure; I don't even have Python 2 installed. What Python version did you use to run it?
3.10.2

2+2*5 = ?
2+2*5 = 20
2+2*5 = 12
2+2*5 = 77034585053198940266692661
mybearworld
Scratcher
1000+ posts

base1114112

mybearworld wrote:

3.10.2
I just updated to 3.10.4, and it works too.

2+2*5 = ?
2+2*5 = 20
2+2*5 = 12
2+2*5 = 77034585053198940266692661
mybearworld
Scratcher
1000+ posts

base1114112

Huh, you seem to be using 3.10.4 and also Windows. What's going on?!

2+2*5 = ?
2+2*5 = 20
2+2*5 = 12
2+2*5 = 77034585053198940266692661
NFlex23
Scratcher
1000+ posts

base1114112

mybearworld wrote:

(#16)
Huh, you seem to be using 3.10.4 and also Windows. What's going on?!
I just figured it out— I was redirecting the code as a string into a file, and that must have added a “stray” bite to the source file.



All I had to do to fix it was copy and paste the code instead of redirecting it. Confusing and weird, but a simple fix!
mybearworld
Scratcher
1000+ posts

base1114112

Not sure what happened there, but at least it works now!
or:
29729117502603902759294619357751443492732166658056602885511808243397316840758332339791274189701813316537979725793198387724370825567057018380189251917723600423235032104696729839588357370642694481125092435485232239561760996608714731913919633256440775782462042436256134675258626178733239364357281679763868893907217051812053147763765346337

2+2*5 = ?
2+2*5 = 20
2+2*5 = 12
2+2*5 = 77034585053198940266692661
mybearworld
Scratcher
1000+ posts

base1114112

bump

Last edited by mybearworld (April 30, 2022 08:06:19)


2+2*5 = ?
2+2*5 = 20
2+2*5 = 12
2+2*5 = 77034585053198940266692661
mybearworld
Scratcher
1000+ posts

base1114112


Nice!

2+2*5 = ?
2+2*5 = 20
2+2*5 = 12
2+2*5 = 77034585053198940266692661

Powered by DjangoBB

Standard | Mobile