This generates one black peg the key is once a peg

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: in Mastermind there is a game board, pegs, colors, codes (the secret code and the player's guesses can both be considered the same data type, a code), feedback results, a computer player, a human player, and an over- all game runner. Some things are so simple you may choose not to implement a class for them. For example the computer player doesn't do anything more than pick the secret code and answer the guesses. Maybe that is simple enough for the Game or Board class to do. Also you may use some pre existing type, primitive or a class, to represent things. E.g. the guesses and results could be String objects. After deciding what classes you need, implement them one at a time, simplest ones first. Test a class thoroughly before going on to the next class. You...
View Full Document

Ask a homework question - tutors are online