I certainly didn't do the decimal-binary conversion in my head (mental arithmetic is not my greatest skill). You can open your browser's JS console and use:
I see some just found the piece of JavaScript that registered the handlers, and others found lists by those people, but...
did anyone else find the codes manually? I did. I quickly realised that it'd break off the code as soon as it couldn't lead to a match, greatly reducing the search space (which was only 256 options to begin with).
As soon as I noticed that, I worked out all the codes by hand in only 15 minutes (including playing with the experiments I found).
I just iterated through the search space (starting at all zeroes, counting up in binary) and eliminated whole sets of numbers as soon as it broke off the input. e.g. starting with all zeroes it breaks off at the third zero, meaning anything under 00100000 was impossible (immediately eliminating 32 of those 256 options in my search).
Did anyone else do that too? Perhaps more interesting: did anyone have a completely different approach?
29 comments
[ 3.1 ms ] story [ 73.0 ms ] threadAnd 10010000 took me to https://developers.google.com/events/io/experiment-bacon
Time to see if I can find any more! :)
pong: 10000001
simone: 11010011
eightbit: 01010011
song: 11011011
synth: 10001000
ascii: 01111111
bowling: 01110101
rocket: 01000101
burger: 00111001
cat: 11100111
bacon: 10010000
This was done a while ago.
Also assuming that everyone has the skill to dig through javascript files.
128, 64, 32, 16, 8, 4, 2, 1
----
Let's decompose 231.
----
231 >= 128; That's a 1 in first position. 1
231 - 128 = 103 >= 64; We have a one in the second position. 11.
103 - 64 = 39 >= 32; One in the third position. 111.
39 - 32 = 7 < 16; Zero in the fourth position. 1110.
7 < 8; Zero in the fifth place. 11100
7 >= 4; 111001
7 - 4 = 3 >= 2; 1110011
3 - 2 = 1 >= 1; Final result: 11100111. Enjoy your cats :)
All you have to do is integer division by two and keep the remainder. You don't even need to know the powers of two.
Here's an example with 137.
Now reverse the order and zero extend if necessary.Final result: 10001001
You can use a similar method to convert the fractional part of a float, but with multiplication.
did anyone else find the codes manually? I did. I quickly realised that it'd break off the code as soon as it couldn't lead to a match, greatly reducing the search space (which was only 256 options to begin with).
As soon as I noticed that, I worked out all the codes by hand in only 15 minutes (including playing with the experiments I found).
I just iterated through the search space (starting at all zeroes, counting up in binary) and eliminated whole sets of numbers as soon as it broke off the input. e.g. starting with all zeroes it breaks off at the third zero, meaning anything under 00100000 was impossible (immediately eliminating 32 of those 256 options in my search).
Did anyone else do that too? Perhaps more interesting: did anyone have a completely different approach?