Just a 10 minute project :-) So bored!
Want to know how it works? http://www.mathmaniacs.org/lessons/01-binary/Magic_Trick/