Hartismere School

Est. 1451. An outstanding coeducational secondary school & sixth form college and England's first academy

Home Login

C# Cook Book // Mastermind (Console)

A C# programming recipe for creating a console game of Mastermind:

The computer generates a 3 digit number.

The player has to guess the number.

The computer states how may digits are correct, and in the correct place.

Difficulty: beginner/intermediate.

Ingredients: You can use repl.it or any C# development environment.

 

 

Arrange your windows so you can view the recipe while you write your code. 

In this section...

C# Cook Book // MatchingPairs (GUI)

C# Yellow Book

C# Cook Book // Calculator (Console)

C# Cook Book // Conversation (Console)

C# Cook Book // Picture Block Puzzle (GUI)

C# Cook Book // Tic Tac Toe (GUI)

C# Cook Book // Quiz (Console)

C# Cook Book // Higher Or Lower (GUI)

C# Cook Book // Word Search (Console)

C# Cook Book // Snake (GUI)

See also...

How robots are taking over warehouse work

House Weeks

Professional Services

Coding Challenges for GCSE and A Level Computer Science

Careers & Futures Programme Feedback - Parents

Labour Market Information (LMI)

Year 12 revision

Binary addition 2

A Level Computer Science

Our curriculum

Explore...

Homework - Digital Video #2

CPU Fetch-Decode-Execute Animation

Hartismere Website :: A History :: 2004

Hartismere Website :: A History :: 2016

Year 9 One Lesson Task :: Goal Seek [Spreadsheet]

DynaMaze - Creating enemies and item pickups

Year 9 One Lesson Task :: No Mouse [Windows]

TwitBook - Can you spot the problems with this profile page?

Computerphile Sudoku Python

MegaProcessor - the largest CPU in the world

New...

January 2026 Examinations

Duke of Edinburgh Portal

The Misleading Ending of Whiplash

Music club timetable

Teacher of English - (Maternity cover - Possible TLR available)

Whiplash Final Scene - Andrew Neyman's Performance

Spring Term Sports Club

Summer 2026 Examinations

Discover...

C# Cook Book Recipes Programming C# Recipes Computer Science C# Security Sports Clubs Careers Spanish Design Technology Website Photography Dance English LMC Just For Fun Learnit Keystage 5 Year 9 Options Revision

Uh-oh - we were unable to load our website on your browser so we're showing you a plain HTML version.

We use many features found in modern browsers and regrettably yours seems incompatible.

However this legacy version contains (very, very nearly) all the same content. Each page is rendered on our server and doesn't rely on any browser features except the odd font. It doesn't even need Javascript or fancy CSS. It's like being in 1995!

Your browser is reporting itself to us as Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com). Please consider updating your browser to make the most of our website.

If you would like to try our proper website again - you can do so here...