Boolean Logic Run
One lane, one bit, and a stream of logic gates falling toward you. Your block shows a 0 or a 1, and when a gate reaches it the game feeds your bit through that gate. The output has to be 1 or the run ends. The start card lists the four gates the way they behave here: AND passes your bit through, OR always gives 1, NOT flips your bit, and XOR flips it too. AND, OR and XOR act as if their second input were wired to 1, and NOT simply inverts.
How to play
- Read the gate list on the start card, then press Start Game. Your bit starts at 0.
- Press the spacebar to flip between 0 and 1. On narrow screens a TAP TO FLIP (0 / 1) button appears below the track.
- Decide as each gate falls. An OR gate passes with either bit, an AND gate needs your bit at 1, and NOT and XOR gates need it at 0.
- The check happens when the gate reaches your block, so your bit at that moment is what counts. A passed gate scores 10 points times the current speed, rounded down, and every fifth gate adds 0.2x to the speed.
- The first gate that outputs 0 ends the run. You see your score, top speed, gates passed, and a rating from Student up to Boolean Genius at 50 gates, next to the best score this browser has recorded.
Why XOR behaves like NOT here
The truth tables are short. AND outputs 1 only when both inputs are 1. OR outputs 1 when either input is 1. XOR outputs 1 when its inputs differ. NOT has a single input and inverts it. With the second input pinned at 1, AND of your bit and 1 is just your bit, OR of your bit and 1 is always 1, and XOR of your bit and 1 is the opposite of your bit, the same as NOT. The game boils down to remembering which gates want a 1 and which want a 0.
The same identities show up in code. x ^ 1 flips the lowest bit of a number, which is how flags get toggled, and x | 1 forces it on. Gates spawn on a fixed 1.5 second timer, but they fall faster as the speed rises, so you get less warning each time. Read each gate's label as soon as it appears and set your bit early, instead of reacting when it arrives.