Implementation of http://tutorials.jumpstartlab.com/projects/mastermind.html