MasterMind Game in C# Free Source Code


This project is called MasterMind Game. It is a software-based game developed using C#. In this game, the user must guess the correct combination of colors to win. It has a simple user interface and user-friendly features and functionalities. The source code is available on this website and is free to download.

How does the MasterMind Game work?

The MasterMind Game has 2 panels/columns inside the interface which is the left-side panel is where the user will place their guessed color by dragging the color below from below to their guessed location of the row. On the right-side panel of the interface, you will see the rows that identify how many colored balls have been guessed right by the user and how many on the right position, and how many colored balls are right but not in the right position. The white color ball on the right side row indicates that the user found the right color but not in the correct position while the black color ball indicates that the user found the correct color in the exact/correct position.

The game contains 3 different buttons which are the New Key, Next Row, and Empty Row buttons. The New Key Button is for starting a game with a New key or combination of colors to guess. The Empty Row Button is used for removing all the added colored balls to the current row. Lastly, the Next Row Button is used for confirming the user's guessed combination color in the current row and proceeding to the next row.

How to play the MasterMind Game?

Here are the steps and instructions on how to play the MasterMind Game:

This game has 8 Possible colored balls and the user/player must find the combination of 5 colored balls.

  1. Press/Click the New Key Button to start the game and generate the combination of colors to guess.
  2. Drag your selected colored ball to your chosen position on the row.
  3. Click the Empty Row Button if you desire to reset and empty the current row.
  4. Click the Next Row Button if you want to submit your guessed combination and proceed to the next row if you fail to guess the right key
  5. You can use the Indicator Colored balls on the right side of the row to check If your guess is correct or some of it.

Game Interface Snapshot

How to Run??


(download and install the following)


  1. Download and Extract the provided source code zip file. (download button is located below)
  2. Locate the solution file inside the extracted source code folder. The file is known as MasterMind.sln.
  3. Open the solution file with your MS Visual Studio Software.
  4. Press the F5 key on your keyboard to run this MasterMind Game Application.

That's it! You can now test the game application on your end and see if it works properly. I hope this MasterMind Game in C# will help you with what you are looking for and that you'll find something useful for current and future C# Projects.

Explore more on this website for more Tutorials and Free Source Codes.

Enjoy =)

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Virus note: All files are scanned once-a-day by for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.


1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

Add new comment