J10M

Joue 10 minutes.

Logic Gates

Place the right gates, flip the switches and make the lamp follow the whole truth table.

Ages 10 and up

Two levers on the left, an empty socket in the middle, a lamp on the right. The socket is waiting for a gate, and you are the one who picks it. Drop in an AND: the lamp will only light up if both levers are up. Drop in an OR: one lever up will be enough. Drop in the wrong one, and the lamp does the opposite of what you were asked.

That is the whole game. It is not an electronics lecture dressed up as a riddle: it is a small machine with a handful of parts that you build and then try out. You flip the levers, the current travels along the wires before your eyes, every wire shows the 0 or the 1 it carries, and the lamp turns on or stays dark. When your circuit does exactly what is asked, for every position of the levers, the level is yours.

These gates are the bricks every processor in the world is made of. A phone holds billions of them. Here you place one to four at a time, and that is plenty to understand what really goes on inside a chip.

If you are looking for a free logic gates game to play online — to learn how AND, OR and NOT work, to finally make sense of a truth table, or to give a student a hands-on way into Boolean logic — this one asks for no theory at all. You learn by wiring.

How to play

Each level is made of three areas.

At the top, the circuit. On the left, one, two or three levers labeled A, B and C. Tap a lever to raise it or lower it. In the middle, the wiring: wires, sometimes gates already fixed in place, and one or more empty sockets marked with a question mark. On the right, the lamp.

In the middle, the truth table. One row for every possible position of the levers, and for each row, what the lamp should do: on or off. That table is the complete brief for the level, spelled out in black and white. A row gets a green check mark once you have tried it and the lamp did the right thing.

At the bottom, the palette. The gates available for this level. Tap one to pick it up: the empty sockets start blinking. Then tap a socket, and the gate snaps into place. Changed your mind? Pick another gate and drop it on top. To empty a socket, tap it with no gate in hand. The Remove all button clears every socket at once.

Then test it. Flip the levers every which way and watch the lamp. Live wires grow thicker, turn yellow and send little dashes of current along their length; dead wires stay thin and gray. Every wire carries a small badge with its value, 0 or 1: you never have to guess what a wire is carrying, because it tells you.

When the circuit is right, the game takes over: it runs through every row of the table by itself, one at a time, and you watch each one get checked off. The lamp bursts into rays, and the next level opens up.

The six gates

You do not meet all six at once. The first world introduces them one by one, and later levels only offer the ones you need.

  • AND — on only if both of its wires are on. The strictest of the bunch.
  • OR — on as soon as at least one of its two wires is on. Careful: if both are on, it is on too. It is not the everyday "or" of "tea or coffee?", where you only get one.
  • NOT — reads a single wire and sends back the opposite. One wire in, one wire out.
  • XOR, or exclusive OR — on if its two wires are different. This is the "tea or coffee" one: one or the other, never both.
  • NAND — the exact opposite of AND: it turns off only when both wires are on.
  • NOR — the exact opposite of OR: it lights up only when both wires are off.

Each gate has its own outline, the same symbols you will find in any textbook: the flat back and round nose of AND, the pointed shield of OR, the triangle of NOT, and the small round bubble that marks the inverted versions. After a few levels you recognize them by their silhouette before you even read the name.

One detail matters a lot: in several levels, both inputs of a socket come from the same wire. A two-input gate placed there receives the same value twice — and that is how you discover that a NAND with both inputs tied together behaves exactly like a NOT. That is not a wiring mistake. It is the key to the last world.

The three worlds

The eighteen levels are split into three worlds of six, and each level opens as soon as you clear the one before it.

The gates, one by one. Six levels, a single socket each time. You place a gate, you test it, you get it. This is where AND, OR, NOT, NAND, NOR and XOR each find their place in your head.

Two gates, and De Morgan. The circuits get longer. You invert one input before combining it with the other, you rebuild a NOR without using a NOR gate, and above all you run into two levels that ask for the same truth table by two different routes: "the opposite of A or B" on one side, "the opposite of A and the opposite of B" on the other. The two circuits look as different as can be, and yet their tables are identical. That has a name, De Morgan's law, and you discover it by building it instead of memorizing it. The world ends with an exclusive OR built from four gates, without being allowed to use the XOR gate.

Three inputs, and the universal gate. One more lever means eight rows in the table instead of four. You build an "all three," an "any one of them," an "A and B together, or C on its own," then a majority vote: the lamp must light up as soon as two levers out of three are up. The last two levels take the idea all the way: rebuild an AND using nothing but NAND gates, then an exclusive OR with four NANDs and nothing else. That is why NAND is called a universal gate — with it alone you can build every other gate, and real chips are designed exactly that way.

Stars

There is no timer: nothing rushes you. What the game counts is your gate placements.

Three stars if you never placed a gate for nothing, which means every socket got the right gate on the first try. Two stars for up to two extra placements. One star beyond that. Replacing a gate counts as a placement; removing one does not.

Your stars and your progress are saved in your browser. The Levels button lets you go back to any level you have opened and try again for a better rating. The game plays entirely by touch on a phone, and entirely by keyboard on a computer: every lever, socket and gate is a button you can reach with Tab and press with Enter or the space bar.

Leaderboard

Every level you clear earns points, and your leaderboard score is the total of all your levels. Points follow your stars, and later worlds are worth more: in the first world, three stars earn 50 points, two earn 40 and one earns 30; the second world pays double, from 60 to 100; the third pays triple, from 90 to 150. Clearing all eighteen levels without a single wasted placement adds up to 1,800 points.

Each level counts once, for your best solution. Replaying a level for more stars raises your total; replaying it worse costs you nothing. The leaderboard only keeps verified solutions: the server replays every placement you made, rebuilds your circuit, checks the whole truth table and recounts your stars before it accepts the score. Flipping levers costs nothing, on screen or on the leaderboard, so test as many rows as you like. The first time you clear a level, the game asks for a nickname, and from then on your total is sent on its own without interrupting your game.

Tips for solving every level

Read the table before you place anything. It tells you everything. How many rows want the lamp on? One out of four is an AND. Three out of four is an OR. Two out of four, on the diagonal — when the levers disagree — is an XOR. One out of four with both levers down is a NOR.

Test every row, not just the one that works. This is the classic mistake: you flip two levers, the lamp does the right thing, you think you have won. But the level only clears when all four rows — or all eight — are right. The green check marks are there to keep you honest.

Work backward from the lamp. When there are several sockets, start at the end: what does the lamp need to receive? Then step back one gate. It is faster than trying gates at random from the left.

Follow the badges. When a circuit does not do what you expect, trace the 0s and 1s wire by wire. The mistake jumps out at the spot where a badge does not carry the value you had in mind.

Two inputs on the same wire are a clue. The circuit is whispering that it wants a gate that only needs one input — or a two-input gate turned into an inverter.

Aim for three stars on a second pass. Once you know how a level works, replay it and place each gate only once. It is a good way to check that you really understood why the circuit works, instead of landing on it by trial and error.

Frequently asked questions

Do I need to know electronics to play? No. There are no volts, no amps, no formulas. A wire carries a 0 or a 1, a gate combines them, a lamp lights up. Everything else you learn by playing.

What age is it for? From about ten years old you can play on your own. The first levels make sense well before that, and the last ones will keep an adult seriously busy.

How long does a level take? A level from the first world takes less than a minute. The last ones call for five to ten minutes of thinking.

Is it useful for school? Yes. Logic gates and truth tables come up in computer science, technology and math classes, and they are the foundation of Boolean logic. But the game does not require any lesson beforehand: the table tells you what to do, and the wires show you what is happening.

Why does the lamp stay off when my gate is right? Because it is only right for the row currently shown. Flip the levers: another position will reveal the mistake. The level clears only when every row of the table is correct.

Can a level be solved in more than one way? Often, yes. Only the truth table counts, not the route you took. Two levels of the second world are even built on purpose to show two different circuits that give the same result.

Is there a leaderboard? Yes: it adds up the points from the levels you have cleared, up to 1,800. The eighteen levels are the same for everyone, and you play them at your own pace.

Do I need an account? No, never. Nothing to install, nothing to download, no sign-up. You open the page and you play; a nickname is all you need to appear on the leaderboard.

More educational games

Educational games
  • Telling Time
    Set both hands to the time you're given, from o'clock times to the exact minute, PM times included.
  • Algebra Balance
    Take away, add, divide — but always on both sides. The scale stays level until x stands alone.
  • Making Change
    The customer pays too much: put the right coins in their hand, and as few as you can.
  • Prime Factor Tree
    Split every number down to its primes, which light up like lanterns. Eight trees against the clock, solo or in a race.
  • Mental Math
    Twenty sums that get harder and harder: answer right, and as fast as you can.
  • Europe Chase
    A thief runs from city to city. Read the clues, follow the trail and name them.
  • Flag Quiz
    Name the flag, or find the flag of the country: twenty rounds, 162 countries.
  • World Capitals
    The capital of a country, or the country of a capital: twenty timed rounds.