Code and comments

Practical and theoretical aspects of software development

Archive for December 2012

Mastermind in Clojure and Java

200px-Mastermind

Have you heard of mastermind? It’s a logic game in which one player repeatedly tries determine the secret code that another player set at the beginning. With each guess, the player is given information on how many correct pegs his guess contains, and how many are in the correct position. For more details on the rules, check the wikipedia article.

I built a Clojure implementation of Mastermind as a learning project. (Code and details of functionality at github.) My primary goals were to gain familiarity with the language, and to see what the functional programming paradigm feels like when working on a project that is larger than one big function. After I finished, I re-implemented (almost) all of the features in Java for a comparison. (Code also available at github.) Interested in the results? read on.

Read the rest of this entry »

Written by Eric Wilson

December 11, 2012 at 12:58 pm

Posted in projects

Tagged with , ,