Skip Navigation
Python|Annie UK


Saturday 27 April 2024


ANSI Mastermind

Below is the souce code for my mastermind game written in Python3. I'm learning Python in my spare time and this was a good starting point. The game has built-in instructions so should not be too difficult to get to grips with.

This game uses ANSI colour codes so you need to launch it in a terminal that supports ANSI codes, You can launch the game in a terminal window on Linux (ctrl+Alt+T), Windows (Win+X choose "windows terminal"), Mac OS (cmd+space type "terminal"), etc… using one of the commands below:

python mastermind.py or python3 mastermind.py

(Make sure you have previously navigated to the folder​/​directory where you have extracted the mastermind.py python script)

Download (Version 1.12): mastermind.zip (5.677 Kb) mastermind.7z (5.246 Kb)

Force Graphic theme (may give unpredictable page rendering)