From Wikipedia: Mastermind or Master Mind is a code-breaking game for two players. The modern game with pegs was invented in 1970 by Mordecai Meirowitz, an Israeli postmaster and telecommunications expert.[1][2] It resembles an earlier pencil and paper game called Bulls and Cows that may date back a century or more.
Red, Yellow, Orange, Green, Blue, Purple, White
Scoring Black, White
Mastermind. (Main.java class if using Repl.it but ok)
Make a game class
gives rules at beginning (could be a method call printRules() )
Scanner class - input user prompts, etc
would make calls to methods to guess position
return for this? int[#cPcL][#cPwL]
Instructions - capture instructions (for text file and UI)\
?PvP = play1 choses secret code (swap places at keyboard)
play2 - takes turn guessing
?PvC = play1 - computer randomizes colors and location of pins
play2 - takes turn guessing
Make a board Class
Pins - Encoding colors - do we use ints or chars?
[R, G, Y, O] [R, B, Y, G] [2][1]
[R, G, Y, O] [R, O, Y, G] [2][2]
Option 2 Layous
[R, G, Y, O] [BP , WP ]
[ , , , ] [2, 2]
int - translate btwn colors
chars - individual letter
PROS
CONS
Ints
-simple to code
chars
-less confusion for player
Arrays - 1-2D array for player guesses
** 1-1D array for the secret code