Skip to content

FranklinChen/annoying-boxes-puzzle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solve an annoying boxes puzzle

Build Status

Solve this annoying boxes puzzle:

There are two boxes on a table, one red and one green. One
contains a treasure. The red box is labelled "exactly one of the
labels is true". The green box is labelled "the treasure is in
this box."

Can you figure out which box contains the treasure?

The followup blog post with solution

Read Mark-Jason Dominus's writeup of the solution.

Print solution

I implemented the solution in Haskell.

You can run it with the GHCi interpreter with:

$ runhaskell src/AnnoyingBoxesPuzzle.hs

Or you can compile to native code and run that (overkill for this little program with no external library dependencies):

$ cabal build
$ cabal run

The output is crude but should be self-explanatory.

Explanation of the solution

TODO

Releases

No releases published

Packages

No packages published