program程序讲解、辅导Python,C/C++,Java编程语言 辅导Database|解析C/C++编程
- 首页 >> Python编程 Assignment 3: Master Mind (Part B)
You are to implement the Master Mind game you started in Assignment 2 by creating a Visual
Studio Project using your project plan as described in your previous submission.
Your completed Master Mind game must demonstrate the following:
✓ You MUST implement your program using the following classes, as a minimum, you may
include more (as appropriate for your game design):
Player class: holds a player’s details including their name, score, wins and the number
of games played.
Board class: holds the current game’s details including each of the player’s previous
moves and associated clues, the number of rows and columns used in the game.
Application file: holds the main() function and controls the overall flow of the game.
You may include other relevant attributes and behaviours to these classes, as identified in
your project plan.
✓ The Player must be able to do the following:
assign a name which is requested at the start of the game and used in the feedback given
see all their previous moves at the start of their turn so they can make an informed choice
type in a code, using either letters or numbers and seeing appropriate feedback on the
accuracy of their input
continue typing in codes and seeing feedback until they either “crack the code” or run out
of turns
quit the game at any time – during or after a game
✓ The Board in the game should have the following characteristics:
a defined number of columns (code slots) and rows (the maximum turns a player has)
be able to display each code entered and given feedback as a specific row
be able to reset the board to empty at the end of a game
not be able to add any more rows beyond the specified number
✓ The Game Application must do the following:
display the “how to play” information at the start of the game
create or select a secret code – using words/letters, symbols and/or numbers
display an appropriate and uncluttered user interface providing relevant information to the
player at all times
ask for and allow the player enter a code
compare the player’s code to the secret code and provide appropriate feedback to the
player (a symbol for a correct letter/number in the correct position and a different symbol
for a correct letter/number but in the wrong position, it is optional to use another symbol
if the letter/number is not in the code)
display the updated game board after each code entered by the player
terminate the game (player wins) when the player has guessed the code
terminate the game (player loses) when the player has run out of turns
provide player stats at the end of the game (wins, loses and score)
the player should be able to QUIT the game at any time
Program Reflection
You must also provide a 300-word written reflection of your object-oriented design and how well
you believe it was to implement. You should cover the following areas:
Discuss why you designed it the way you did.
▪ Why did you create your classes that way?
▪ How does this reflect an OO design or approach?
Discuss how well you were able to code it
▪ Highlight any issues you found once you tried to implement your design.
▪ How did you resolve these issues?
If you were to do this project again, discuss how you might change your design to make your
solution easier to implement, more efficient, or better for code reuse.
This must be a Word or PDF document which must be included in the same folder as your *.sln
file. Your document file MUST be named as follows:
“YourFistNameLastName_A3.docx” or “YourFistNameLastName_A3.pdf”.
Extra Functionality
The marking criteria indicates that you should make some individual additions to this in order to
achieve the final 20% of the mark.
Following is a list of additional features you can include, with the maximum number of marks [x]
you can earn for each one. You may implement one or more features from the list, but you will
only score up to the maximum of 20% of the total assignment marks or 20 marks.
You should aim to add some additional creative elements to the gameplay, as well as advanced
object-oriented design elements or advanced use of pointers.
Add a theme to the game which is incorporated into the game play through the story and
the feedback given (for example: Word Detective, Number Cruncher, etc.) [2]
The player can select a skill level [eg: Novice (Detective), Thinker (Inspector) and Master
Mind (Chief Inspector)] which modifies the game parameters – the number of elements in
the code and the number of rows (turns) the player has to solve it. For example: easy has 4
elements out of 6 with 10 rows, tricky has 5 elements out of 8 with 12 rows and hard has 6
elements out of 10 with 14 rows. [4]
Implement an appropriate scoring system based on the game parameters – number of turns
taken, a bonus for unused rows, +/- point based on a win or a loss, etc. [3]
Read in word and/or element lists from a file (based on word length, such as 4-, 5- and 6-
letter words, numbers or symbols) and store appropriately. Word lists should have at least
20+ words of each length. The list used in the game could be linked to a player skill level
and/or randomly selected at the start of each game. To help you a text file (jotto.txt) has
been given, you can find it on Moodle. [6]
Give the player additional options apart from just typing the code or quitting the game. This
could include options to: ask for help (displays an information screen loaded from a file), ask
for a hint (displays a random element from the secret code and must be a limited option),
ask to resign from the current game but not quit the entire game (ends the current game as
if the player ran out of turns and displays the secret code). [4]
Display the board using ASCII art. [4]
Allow the game to be saved and restored at the player’s request. [4]
Allow the player to select what elements will be used in the code (numbers, symbols, letters,
words). Words should range from 4- to 6-letter words, while a specific range of numbers or
set of letters/symbols should be clearly identified and displayed to the player. The feedback
symbols can remain the same, you can use (jotto.txt). [5]
Ask the player if they want to be promoted to the next skill level after winning 5 games. If
they accept their skill level is increased by one (to the maximum level permitted in your
game). Also, if the player loses 5 games in a row they are automatically demoted one skill
level (to the minimum level permitted in your game). [5]
Implement a more sophisticated computer player. The computer player should be able to
have its own Player object (including name and any other player stats as required for your
game), and score the points the human player would lose plus earn a suitable bonus for the
win. It should also make intelligent choices for words/letters, symbols or numbers including
using doubles or triples of the same letter/symbol/number. It should also have the ability to
give random comments to the player based on how well (or not) the player is doing. [10]
You certainly do not have to implement all of the above to earn marks for extra functionality. Just
remember the maximum number of marks you can earn are given in [x]. It is up to you!
Assignment 3: Marking Criteria [up to 100 marks in total]
Does the program compile and run? Yes or No
50 marks penalty will be applied for a non-compiling program.
1. Class Design [15]
1.1. Player Class [5]
1.1.1. Has an appropriate header file [2]
1.1.2. Required data members and member functions using meaningful names [1]
1.1.3. Contains only aspects that relate to a “player” (has no data members or member functions that
are not directly related to a Player) [2]
1.2. Board Class [5]
1.2.1. Has an appropriate header file [2]
1.2.2. Required data members and member functions using meaningful names [1]
1.2.3. Contains only aspects that relate to a “board” (has no data members or member functions that
are not directly related to the board) [2]
1.3. Game Application [5]
1.3.1. Has an appropriate header file [2]
1.3.2. Has appropriate variables and functions using meaningful names [2]
1.3.3. The main() function has appropriate function calls to keep it uncluttered [1]
2. Functionality [35]
2.1. Game set up including: displaying “how to play” information, initialising the player and game
variables, creating the secret code using appropriate data, etc. [5]
2.2. Implementation of a clear and uncluttered User Interface display [5]
2.3. Successful implementation of action processes [5]
2.4. Successful implementation of calculating and displaying the correct clues [5]
2.5. Appropriate feedback to player’s interactions [5]
2.6. Appropriate feedback displayed to the player [5]
2.7. Appropriate end game conditions triggered [5]
3. Quality of Solution and Code [20]
3.1. Does the program perform the functionality in an efficient and extensible manner? [12]
3.1.1. Appropriate use of functions and function calls [1]
3.1.2. Appropriate use of data types [1]
3.1.3. Appropriate use of decisions, loops and other programming techniques [2]
3.1.4. Appropriate use of references and/or pointers [5]
3.1.5. Appropriate use of good programming practices and techniques [2]
3.1.6. Extraneous and redundant code removed [1]
3.2. Has a well-designed OO program been implemented? [4]
3.2.1. Contains classes appropriate to the assignment brief [3]
3.2.2. Program structures support and OO design [1]
3.3. Has the Programming Style Guide been followed appropriately? [4]
3.3.1. Appropriate commenting and code documentation [2]
3.3.2. Correct formatting of code within *.h and *.cpp files [2]
4. Extra Functionality [maximum 20]
4.1. Incorporate a theme into the story and feedback given to the player [2]
4.2. Implement difficulty levels which may be selected by the player [2]
4.3. Implement an appropriate scoring system based on game parameters [3]
4.4. Read word lists from a file and store appropriately [3]
4.5. Player has additional command choices [4]
4.6. Display the board using ASCII art [4]
4.7. Allow the game to be saved and restored at the player’s request [4]
4.8. Allow player to select which elements to use [5]
4.9. Player promotion/demotion every 5 games won/lost [5]
4.10. Implement a more sophisticated computer player [10]
5. Reflection [10]
5.1. Discussion of motivations for the program design [3]
5.2. Discussion of how well the design was to implement [3]
5.3. Discussion of what they would do differently if they were to start it again [4]
Assignment Notes:
It is your responsibility to know what is expected of you. If you are unsure about anything, ask
your tutor sooner rather than later. Write any questions and/or notes here to help you clarify what
you have to do.
Note: Your tutor may ask you to program part of your assignment in class
to determine that you have completed the work yourself. Failure to do this
to an acceptable level will result in you being referred to the Subject
Leader for plagiarism.
In-Class interviews: Also, you may be required to demonstrate your code
to your tutor after the submission deadline. Failure to demonstrate will
lead to zero marks being awarded to the entire assignment.
Note: Submitting only .sln file, a zero mark will be granted.
Here are some sample screen shots to help you develop your user interface:
You are to implement the Master Mind game you started in Assignment 2 by creating a Visual
Studio Project using your project plan as described in your previous submission.
Your completed Master Mind game must demonstrate the following:
✓ You MUST implement your program using the following classes, as a minimum, you may
include more (as appropriate for your game design):
Player class: holds a player’s details including their name, score, wins and the number
of games played.
Board class: holds the current game’s details including each of the player’s previous
moves and associated clues, the number of rows and columns used in the game.
Application file: holds the main() function and controls the overall flow of the game.
You may include other relevant attributes and behaviours to these classes, as identified in
your project plan.
✓ The Player must be able to do the following:
assign a name which is requested at the start of the game and used in the feedback given
see all their previous moves at the start of their turn so they can make an informed choice
type in a code, using either letters or numbers and seeing appropriate feedback on the
accuracy of their input
continue typing in codes and seeing feedback until they either “crack the code” or run out
of turns
quit the game at any time – during or after a game
✓ The Board in the game should have the following characteristics:
a defined number of columns (code slots) and rows (the maximum turns a player has)
be able to display each code entered and given feedback as a specific row
be able to reset the board to empty at the end of a game
not be able to add any more rows beyond the specified number
✓ The Game Application must do the following:
display the “how to play” information at the start of the game
create or select a secret code – using words/letters, symbols and/or numbers
display an appropriate and uncluttered user interface providing relevant information to the
player at all times
ask for and allow the player enter a code
compare the player’s code to the secret code and provide appropriate feedback to the
player (a symbol for a correct letter/number in the correct position and a different symbol
for a correct letter/number but in the wrong position, it is optional to use another symbol
if the letter/number is not in the code)
display the updated game board after each code entered by the player
terminate the game (player wins) when the player has guessed the code
terminate the game (player loses) when the player has run out of turns
provide player stats at the end of the game (wins, loses and score)
the player should be able to QUIT the game at any time
Program Reflection
You must also provide a 300-word written reflection of your object-oriented design and how well
you believe it was to implement. You should cover the following areas:
Discuss why you designed it the way you did.
▪ Why did you create your classes that way?
▪ How does this reflect an OO design or approach?
Discuss how well you were able to code it
▪ Highlight any issues you found once you tried to implement your design.
▪ How did you resolve these issues?
If you were to do this project again, discuss how you might change your design to make your
solution easier to implement, more efficient, or better for code reuse.
This must be a Word or PDF document which must be included in the same folder as your *.sln
file. Your document file MUST be named as follows:
“YourFistNameLastName_A3.docx” or “YourFistNameLastName_A3.pdf”.
Extra Functionality
The marking criteria indicates that you should make some individual additions to this in order to
achieve the final 20% of the mark.
Following is a list of additional features you can include, with the maximum number of marks [x]
you can earn for each one. You may implement one or more features from the list, but you will
only score up to the maximum of 20% of the total assignment marks or 20 marks.
You should aim to add some additional creative elements to the gameplay, as well as advanced
object-oriented design elements or advanced use of pointers.
Add a theme to the game which is incorporated into the game play through the story and
the feedback given (for example: Word Detective, Number Cruncher, etc.) [2]
The player can select a skill level [eg: Novice (Detective), Thinker (Inspector) and Master
Mind (Chief Inspector)] which modifies the game parameters – the number of elements in
the code and the number of rows (turns) the player has to solve it. For example: easy has 4
elements out of 6 with 10 rows, tricky has 5 elements out of 8 with 12 rows and hard has 6
elements out of 10 with 14 rows. [4]
Implement an appropriate scoring system based on the game parameters – number of turns
taken, a bonus for unused rows, +/- point based on a win or a loss, etc. [3]
Read in word and/or element lists from a file (based on word length, such as 4-, 5- and 6-
letter words, numbers or symbols) and store appropriately. Word lists should have at least
20+ words of each length. The list used in the game could be linked to a player skill level
and/or randomly selected at the start of each game. To help you a text file (jotto.txt) has
been given, you can find it on Moodle. [6]
Give the player additional options apart from just typing the code or quitting the game. This
could include options to: ask for help (displays an information screen loaded from a file), ask
for a hint (displays a random element from the secret code and must be a limited option),
ask to resign from the current game but not quit the entire game (ends the current game as
if the player ran out of turns and displays the secret code). [4]
Display the board using ASCII art. [4]
Allow the game to be saved and restored at the player’s request. [4]
Allow the player to select what elements will be used in the code (numbers, symbols, letters,
words). Words should range from 4- to 6-letter words, while a specific range of numbers or
set of letters/symbols should be clearly identified and displayed to the player. The feedback
symbols can remain the same, you can use (jotto.txt). [5]
Ask the player if they want to be promoted to the next skill level after winning 5 games. If
they accept their skill level is increased by one (to the maximum level permitted in your
game). Also, if the player loses 5 games in a row they are automatically demoted one skill
level (to the minimum level permitted in your game). [5]
Implement a more sophisticated computer player. The computer player should be able to
have its own Player object (including name and any other player stats as required for your
game), and score the points the human player would lose plus earn a suitable bonus for the
win. It should also make intelligent choices for words/letters, symbols or numbers including
using doubles or triples of the same letter/symbol/number. It should also have the ability to
give random comments to the player based on how well (or not) the player is doing. [10]
You certainly do not have to implement all of the above to earn marks for extra functionality. Just
remember the maximum number of marks you can earn are given in [x]. It is up to you!
Assignment 3: Marking Criteria [up to 100 marks in total]
Does the program compile and run? Yes or No
50 marks penalty will be applied for a non-compiling program.
1. Class Design [15]
1.1. Player Class [5]
1.1.1. Has an appropriate header file [2]
1.1.2. Required data members and member functions using meaningful names [1]
1.1.3. Contains only aspects that relate to a “player” (has no data members or member functions that
are not directly related to a Player) [2]
1.2. Board Class [5]
1.2.1. Has an appropriate header file [2]
1.2.2. Required data members and member functions using meaningful names [1]
1.2.3. Contains only aspects that relate to a “board” (has no data members or member functions that
are not directly related to the board) [2]
1.3. Game Application [5]
1.3.1. Has an appropriate header file [2]
1.3.2. Has appropriate variables and functions using meaningful names [2]
1.3.3. The main() function has appropriate function calls to keep it uncluttered [1]
2. Functionality [35]
2.1. Game set up including: displaying “how to play” information, initialising the player and game
variables, creating the secret code using appropriate data, etc. [5]
2.2. Implementation of a clear and uncluttered User Interface display [5]
2.3. Successful implementation of action processes [5]
2.4. Successful implementation of calculating and displaying the correct clues [5]
2.5. Appropriate feedback to player’s interactions [5]
2.6. Appropriate feedback displayed to the player [5]
2.7. Appropriate end game conditions triggered [5]
3. Quality of Solution and Code [20]
3.1. Does the program perform the functionality in an efficient and extensible manner? [12]
3.1.1. Appropriate use of functions and function calls [1]
3.1.2. Appropriate use of data types [1]
3.1.3. Appropriate use of decisions, loops and other programming techniques [2]
3.1.4. Appropriate use of references and/or pointers [5]
3.1.5. Appropriate use of good programming practices and techniques [2]
3.1.6. Extraneous and redundant code removed [1]
3.2. Has a well-designed OO program been implemented? [4]
3.2.1. Contains classes appropriate to the assignment brief [3]
3.2.2. Program structures support and OO design [1]
3.3. Has the Programming Style Guide been followed appropriately? [4]
3.3.1. Appropriate commenting and code documentation [2]
3.3.2. Correct formatting of code within *.h and *.cpp files [2]
4. Extra Functionality [maximum 20]
4.1. Incorporate a theme into the story and feedback given to the player [2]
4.2. Implement difficulty levels which may be selected by the player [2]
4.3. Implement an appropriate scoring system based on game parameters [3]
4.4. Read word lists from a file and store appropriately [3]
4.5. Player has additional command choices [4]
4.6. Display the board using ASCII art [4]
4.7. Allow the game to be saved and restored at the player’s request [4]
4.8. Allow player to select which elements to use [5]
4.9. Player promotion/demotion every 5 games won/lost [5]
4.10. Implement a more sophisticated computer player [10]
5. Reflection [10]
5.1. Discussion of motivations for the program design [3]
5.2. Discussion of how well the design was to implement [3]
5.3. Discussion of what they would do differently if they were to start it again [4]
Assignment Notes:
It is your responsibility to know what is expected of you. If you are unsure about anything, ask
your tutor sooner rather than later. Write any questions and/or notes here to help you clarify what
you have to do.
Note: Your tutor may ask you to program part of your assignment in class
to determine that you have completed the work yourself. Failure to do this
to an acceptable level will result in you being referred to the Subject
Leader for plagiarism.
In-Class interviews: Also, you may be required to demonstrate your code
to your tutor after the submission deadline. Failure to demonstrate will
lead to zero marks being awarded to the entire assignment.
Note: Submitting only .sln file, a zero mark will be granted.
Here are some sample screen shots to help you develop your user interface: