Looo.lol – a binary math site
looo.lol
looo.lol
> Yes!
> 80085 is 00000000000000000 in binary!Edit: meant answer not result
It took me a while to figure out the answer, but it was because the buttons disappear off the screen on a mobile device. I had to play in landscape mode.
There is also a small bug where if you swipe to flip the bits, the button state is no longer in sync
Algo:
* Start at the left most number
* Click the number
* If the result is higher than target click again to turn it off
* Move right, back to step 2For a proper binary search you should right nextdigit+first digit/2, if you're going backwards.
-specifically, some of the first few numbers are 69 and 80085
I also can’t help but mention that I already know the answer to this example from one of my favorite jokes in Futurama: https://youtube.com/watch?v=_4TPlwwHM8Q
https://flippybitandtheattackofthehexadecimalsfrombase16.com...
I also play this one which I think was posted on HN a while ago: https://play.google.com/store/apps/details?id=go.lang.bintri...
If there was some binary addition, subtraction, bitflipping, and other "tricks" of working with binary, or shortcuts/pattern recognition - i think there would be more to this.
You could expand this game with much more advanced operations and tricks that people devised but I guess those would involve algorithms too. Floating point would be a good expansion and much better interactively than a textbook.
Should be made mobile responsive. Difficult to use on mobile.
1) off by one errors
(in this case it comes in the annoying form of messed up floor/ceil calculations)
https://looo.lol/?x=1 (I like the “Binary math can seem hard, but it's actually quite simple.”)
But the number of values is just 2^n, because that includes zero.
Anyone who says flexbox “solved” centering hasn’t been paying attention.
It blows my mind that this is the “best” (or at least most ubiquitous) layout engine in existence.
Edit: to be more constructive, can anyone offer the OP a concise, CSS-only, diff that would fix the mobile issue without changing the DOM structure or layout on larger screens? It might be possible with a min-width: fit-content, but I have no development setup available at the moment.
and maybe, if you want, a `min-width` on the boxes themselves
It’s sad that this had been up for so long with no real solutions. A genuine failure of the CSSWG.
In this case, I'd probably switch to an automatic grid layout with equal size boxes regardless of content size. Then it could neatly wrap into multiple rows while keeping the boxes at a constrained size.
I still have kind of mixed feelings about a website that does not use bit lengths that are powers of 2.