This is a code challenge from the Ruby Quiz site. All of the solutions I saw implemented this using a binary tree but it felt like a better fit for constraint propagation to me so I put together a sample to play with the idea.
run with the -gui command line parameter to use a graphical user interface instead of the usual command line.