w

Master Mind


Technologies: C++, Command Line


Field: Software Engineering


Completed: March 2018

Master Mind was an individual first-year deliverable as part of EE Software Engineering I module. The project was designed to introduce us to and apply our knowledge gained from weekly lab sessions, specifically dealing with data structures such as hash maps, vector operation and structs. The game is written purely in C++ and can run on the command line with some user input parameters to run the game algorithms.


Unlike 2048, this assignment was less strict to specification and had a competitive nature as the fastest timed solution scored highest marks. A report was also written to explain our approach, decision decisions and evaluation of time-based performance metrics. A skeleton code was provided for a working maker and solver, albeit the latter being highly inefficient. The overall aim of the assignment was to improve these two functionalities and present a competitive code.


In this game, the user must provide an input for length and sequence of the code to be tested. The game then generates a random sequence of numbers defined by input length with numbers ranging from 0...N. The code solver tries to find the optimum sequence using minimum number of attempts and receives feedback on its guess. If the guess includes a number at the correct position, the solver returns a black hit or if the guess includes a number at the wrong position the solver returns a white hit. By doing so, the game can eliminate large proportions of all possible solutions and make a better guess as its next move is based on historic data about black/white hits. The game ends when a sequence, of length L, has been found with all L black hits and no white hits.


My key learning in this project was algorithmic software engineering skills. It was my first experience of a large project where I learned how to choose the best data structure, in this case hash maps, for the purpose of Max Parts algorithm. I had to independently research suitable algorithms and my report compares the performance metrics for different algorithms. This gave me a stronger understanding of how a programmer has to holistically think of many solutions before deciding optimum one.


A link to the project source code and accompanying report on GitHub can be accessed here.

← Back to Projects