Open Magnogen opened 1 year ago
2 + 2 = 5!
delete 1!
delete 2!
delete 4!
delete 5!
delete 6!
delete 7!
delete 8!
delete 9!
Math.PI? // 3 - the engineer's dream
If you want to add a number back, you can just use simple math, as long as you have at least one digit available and haven't deleted too many operators. This is only possible if DreamBerd defines 0^0
to be 1 (a fairly common choice).
You can get 1 from any other non-zero digit using 1 = d/d!
where d
is the digit. Once you have 1, you can just use
2 = 1 + 1!
3 = 2 + 1!
...
until you have the rest of them. If you have zero as the only digit, you can use 0^0
to get to 1.
Actually, I just thought of something else: Even if you completely remove all digits, you might still be able to get them back with some clever undefined
trickery, since 0/0 == undefined
. Obviously 0 = undefined*0!
wouldn't work...
And because integers are stored as arrays of digits, it would make sense that: