Dwarven computer puzzle.
A large room with a row of five pressure plates, two levers, and four rows of steel hatches. There are five hatches per row, all of them are open. On the other side of the hatches are three passageways. Magma flows through the passageways on either side and down into what seems to be endless darkness.
Operation: The pressure plates are an input for the calculator, which is essentially a binary adder. Hatches are the display of the calculator - open are "zero", closed are "one". The two levers are the "add" lever and the "reset" lever. Players stand on the pressure plates and pull the "add" lever, which adds the result to the first row (closest to players). Naturally, the first result is an exact copy of the players' positions. Pulling the lever again will add the current input to the current result, closing the next row of hatches. Pulling the "reset" lever will drop all hatches and maybe a monster into the room from an unseen cavity above.
The danger: if the players don't understand the principle, they will either block off the path to the central passage, open a path for magma to reach them across the closed hatches, or both. An additional challenge could be provided with random monsters released into the room with each pull of the "reset" lever, and disabling the "reset" lever once the last combination has been entered.
The solution: Several, but the easiest can be don by just two players. One stands on a pressure plate, the other pulls the "add" lever. The third plate has to be pressed first, then the rest can be the first plate thrice, resulting in a straight line down the center and one tile of hot magma dangerously close to the adventurers but not quite deadly yet.
Expansion: The puzzle can be expanded and complicated in various ways. Using a bigger "display", hazards other than magma (like monsters), limiting the players' options in pressing the plates, locking the players in the room and adding a timer (like the pit not being quite bottomless and the magma slowly rising), are all viable options.
The trap isn't really possible in actual DF because hatches can't support other hatches, but seems like a neat idea otherwise.