K
Kraig
Hi! As a total newcomer to C++ and programming, I'm trying to create a
variant of the mastermind game using two classes. Why two classes?
Because it will help me understand how classes and constructors work.
I've seen examples of the program, but none use a two class structure.
**What I'm looking for is design thoughts (what data/attributes and
methods?) for the classes.
Basically, what happens is when the game starts, at creation of an
instance, the computer chooses a random string of digits. The user can
specify the length of the string and the range of digits to be used in a
class constructor. If, for example, the user wants to have seven
different digits, only the digits 1, 2, 3, ...7 will be used. In this
case, the string 45561 would be a string of length five. The player's
job is to find out which string the computer chose using a series of
guesses.
As always, ideas/comments appreciated!
variant of the mastermind game using two classes. Why two classes?
Because it will help me understand how classes and constructors work.
I've seen examples of the program, but none use a two class structure.
**What I'm looking for is design thoughts (what data/attributes and
methods?) for the classes.
Basically, what happens is when the game starts, at creation of an
instance, the computer chooses a random string of digits. The user can
specify the length of the string and the range of digits to be used in a
class constructor. If, for example, the user wants to have seven
different digits, only the digits 1, 2, 3, ...7 will be used. In this
case, the string 45561 would be a string of length five. The player's
job is to find out which string the computer chose using a series of
guesses.
As always, ideas/comments appreciated!