Conversation

fun fact: 1+1=3

python code for proof attached

import ctypes
ctypes.cast(id(2), ctypes.POINTER(ctypes.c_uint64))[3] = 3

print(f"1 + 1 = {1 + 1}")
2
7
10

@charlotte
Did you just replace 2 with a 3? Would replacing it with, say "A" also work?

1
0
0

@RedstoneLP2 with more complicated code you can replace any object with any other, but here i’m just replacing the value of the number 2 with 3

0
0
1
@charlotte
Wasn't it the point of a whole internet challenge to make your language say 1+1=3?

If I recall correctly it was either the JS or the PHP answer that were the weirdest... Like there's some seriously fucked-up shit going on with both language's typecasting
1
0
1

@miifox yeah i think i got the idea from that SO thread

0
0
1

@niko huh they broke that trick at some point

replace the last line with just 1+1

0
0
0