About Two Jugs
Two Jugs is a measuring puzzle that has been set in classrooms, job interviews and at least one action film. You have a tap, a drain and two jugs with no markings. One holds, say, three litres and the other five. Now measure exactly four.
How it works
There are six buttons: fill either jug, empty either jug, or pour one into the other. The jug sizes and the target are chosen at random from combinations that can always be solved. The step counter rewards a short solution.
The method
The trick is that pouring from one jug into the other measures the difference between them. Fill the five-litre jug and pour it into the three until that is full. Two litres remain in the big jug. You have measured two without any markings.
From there, a simple routine solves every puzzle. Choose one jug as the "giver" and the other as the "receiver". Fill the giver. Pour it into the receiver. Whenever the receiver is full, empty it. Whenever the giver is empty, fill it again. Keep going and the amounts will cycle through every whole number of litres the jugs can make. Stop when the target appears.
It works in either direction. Filling the small jug and pouring into the large one gives a different sequence of amounts, and one of the two routes is usually shorter. If your first attempt takes ten steps, try it the other way round.
For 3 and 5 making 4: fill the five, pour into the three, empty the three, pour the remaining two across, fill the five again, and top up the three. One litre leaves the big jug, and four are left. Six steps.
It is one of the shortest HTML5 games on the site, and one of the most pleasing when the answer clicks.