ScratchData LogoScratchData
Back to gregatku's profile

Greg's Mastermind

GRgregatku•Created April 29, 2018
Greg's Mastermind
40
31
1336 views
View on Scratch

Instructions

Greg's Mastermind (updated to work properly in 3.0) Click the Green Flag to receive full instructions. Use Up/Down Arrows to change # of Colours (6-10). Hit Space or (GO) to start solving the randomly generated Code. Click a colour on the left side of the screen to choose it, then click on the position on the board where you want to place it. Hit the [check results] button to complete a guess. Try to crack the code in less turns than there are colours in the game. For the record, if you play with the minimum of 6 colours (as per the original game invented in 1970 by Mordecai Meirowitz), you should be able to guess the correct Code in 5 or less guesses, every time, provided your 1st guess contains one repeated colour. If your 1st guess has 4 different colours and you play perfectly, it is possible on your 5th guess to have a 50/50 situation where you're just going to have to guess which of the 2 possibilities it is! The use of Black pegs to indicate right colour right spot, and White pegs to indicate right colour wrong spot, is as per the original 19070 board game. Any Blacks are supposed to be shown first, followed by any Whites. However the position of the Black/White Pegs doesn't actually matter, because it is just a count of how many you got, and does not in any indicate which ones are correct. You should also be able to solve every puzzle no matter how many Colours you chose to play with, in less guesses than you had colours.

Description

Created by @gregatku for use in Coding Classes for Kids Unlimited, for whom I work as a Coding teacher. The project is a simulation of the classic Mastermind code cracking game, but with 6-10 colours and repeated colours allowed. Students get a version of this with the code for counting Blacks (right colour, right position) and Whites (right colour, wrong position) removed, which they'll then have to write. If you like this game I have 3 other variants of Mastermind, namely Number Mastermind, WORD Mastermind and BreakLock, all of which can be found in my "Mastermind - 4 Ways" studio - https://scratch.mit.edu/studios/31175802/ By the way this project has been recently updated (August 2024) to include the same sound effects as my Number & WORD Mastermind projects, and to function the same way as they do (even though this project has the colour & position selection code in the main Sprite (whereas in the other 2 projects it's in the Stage). It has also had some costume changes to work around an issue with iPads replacing a Vector text string of a series of spaces with a single space. I am 99% certain there are no bugs in this project, but if you think you've found one please let me know about it in the Comments, However please provide enough information for me to be able to reproduce the problem, otherwise I won't be able to debug it! ENJOY - Regards Greg

Project Details

Project ID219480055
CreatedApril 29, 2018
Last ModifiedJune 17, 2025
SharedMay 4, 2018
Visibilityvisible
CommentsAllowed