4 ms·
A related puzzle: https://www.quaxio.com/know_your_bits/ https://www.quaxio.com/know_your_bits/ More such puzzles: http://www.cs.cmu.edu/afs/cs/academic/class/
by amenghra 4y ago
A related puzzle: https://www.quaxio.com/know_your_bits/ https://www.quaxio.com/know_your_bits/
More such puzzles: http://www.cs.cmu.edu/afs/cs/academic/class/15213-f02/www/L1.html http://www.cs.cmu.edu/afs/cs/academic/class/15213-f02/www/L1... and http://csapp.cs.cmu.edu/public/datalab.pdf http://csapp.cs.cmu.edu/public/datalab.pdf
Bit Twiddling Hacks: http://graphics.stanford.edu/~seander/bithacks.html http://graphics.stanford.edu/~seander/bithacks.html
- flyingcircus3 4y agoFor the first puzzle, code that determines if a value has one bit high, without any if/while/for, here's what I got: !(x & (x-1)) && x Was there a "best" solution somewhere? I couldnt get the code window to work.
- amenghra 4y ago-1 is not an allowed operator in my puzzle.