莫纳什大学MCD4720 课业解析

欢迎使用51辅导,51作业君孵化低价透明的学长辅导平台,服务保持优质,平均费用压低50%以上! 51fudao.top

题意:

使用VS开发一个C++游戏——“Left-Center-Right”,主要目的是熟悉涉及多个类的C++项目的设计与实现

解析:

分为两个assignment:

Assignment 2:

项目设计部分要罗列出程序大纲和体现类关系的UML图。

Assignment 3:

按照项目设计实现各个类。

  • 游戏玩法:
    支持3~10位玩家,每位玩家初始分配3个chips,共有3个骰子,选定一位玩家开始游戏。玩家投掷和自己拥有chips同等数量的骰子(不大于3个),根据每个骰子的结果移动手中的chips。骰子一共有6面,其中3面是0,表示不进行任何操作;1面是R,表示把一个chip给右边的玩家;1面是L,表示把一个chip给左边的玩家;1面是C,表示把一个chip给中间的pot。一名玩家回合结束后按顺序让下一名玩家开始游戏回合。游戏一直进行,即使玩家没有chips也要参与(因为有可能邻居会把chips给他),直到只有一名玩家拥有chips,游戏结束。

  • 显示状态:

  • 实现思路:
    我们可以使用四个主要类来实现功能:Player,Dice,Game_driver,Main。

  1. Player:
    储存玩家名字和持有chips的数量等信息。
  2. Dice:
    模拟玩家投掷骰子,随机生成一个数值
  3. Game_driver:
    模拟游戏主持人,负责调度游戏、打印游戏信息以及判断游戏是否结束
  4. Main:
    定义游戏初始信息,主程序

涉及知识点:

代码示例:



更多可加微信讨论

\color{blue}{微信号:IT\_51zuoyejun}

pdf全文

Assignment Submissions

This project will be submitted in two parts. Both parts of the assessment are equally important for the successful
completion of your project, so it is essential that you understand the requirements of both parts before you start.

    ● Assignment 2 : Left-Centre-Right (Part A: Project Plan)

  1. Deadline: August 9, 2019, 19:55pm

  2. Marks:This assignment will be marked out of 100 points.

  3. Weighting: 10% of your final mark for the unit.

    This assignment is the first part of a larger project, which you will complete in Assignment 2. This task cons
    ists of your project planning documentation. It will include details of the Requirements & Analysis of your pr
    ogram, including UML Class diagrams.

    The purpose of this assignment is to get you comfortable with planning a C++ programming project for Assi
    gnment 2.The task is detailed later in this assignment specification, as are the specific marks allocation.

    ● Assignment 3 : Left-Centre-Right (Part B: C++ Project Implementation)

  1. Deadline:September 10, 2019, 19:55pm

  2. Marks: This assignment will be marked out of 100 points.

  3. Weighting:20% of your final mark for the unit.

    This assignment consists of your implementation of your project, as outlined in your Project Planning docum
    ent (Assignment 2). Your project must follow your project plan and must be submitted as a Visual Studio proj
    ect,including all header and code files, and any appropriate text files to ensure the program compiles and ru
    ns.

    This assignment consists of one Application file and associated custom Class files. The purpose of this a
    ssignment is to get you comfortable with designing and implementing basic multi-class C++ programs. The t
    ask is detailed later in this assignment specification, as are the specific marks allocation.

Late submission:

● By submitting a Special Consideration Form or visit this link: https://goo.gl/xtk6n2
● Or, without special consideration, you lose 5 marks per day that you submit late (including weekends) f
or assignment 2 and 10 marks per day for assignment 3. Submissions will not be accepted more than 10 days 
late for assignment 2 and 5 days late for assignment 3.This means that if you got Y marks, only (Y-n×5) 
will becounted for assignment 2 and (Y-n×10) will be counted for assignment 3 where n is the number of day
s you submit late.

Plagiarism:

It is an academic requirement that the work you submit be original. If there is any evidence of copying (including from
online sources without proper attribution), collaboration,pasting from websites or textbooks, Zero marks may be awarded for the whole assignment, the unit or you may be suspended or excluded from your course. Monash Colleges policies on plagiarism, collusion, and cheating are available here or see this link: https://goo.gl/bs1ndF

Further Note:

When you are asked to use Internet resources to answer a question, this does not mean copy-pasting text from websites.
Write answers in your own words such that your understanding of the answer is evident. Acknowledge any sources by citing them.

Submission Instructions:
This project will be submitted in two parts:

    ● Assignment 2 – Part A: consists of your project planning documentation.

This document will include an outline of your program and UML Class diagrams.The assignment must be created and submitted as a single Word or PDF document to the Moodle site. This document must clearly identify both your Name and Student ID to facilitate ease of assessment and feedback.Your document file MUST be named as follows:

“YourFirstNameLastNameID_A2.docx” or “YourFirstNameLastNameID_A2.pdf”.

This file must be submitted via the Moodle assignment submission page.The document should contain the project plan and the UML diagrams. You can use Microsoft Vision to draw the UML diagrams or you can use any other software, provided that the diagrams are included in your submitted document.Explicit assessment criteria are provided, however please note you will also be assessed on thefollowing broad criteria:

○ Detail of a proposed project plan for the overall project.
○ Creating accurate and complete UML diagrams.
○ Using appropriate naming conventions, following the unit Programming Style Guide.

    ● Assignment 3 – Part B: consists of your implementation of your dice game.

Your project must follow your project plan and must be submitted as a Visual Studio project,including all header and code files, and any appropriate text files to ensure the program compiles and runs.You may complete the tasks in your preferred IDE, however you MUST create a Visual Studio project in order to submit. Your project folder must be identified by using your name, ID and assignment number, such as YourFirstNameLastNameID_A3.The entire project folder must then be zipped up into one zip file for submission. The zip file MUST be named “YourFirstNameLastNameID_A3.zip”. This zip file must be submitted via the Moodle assignment submission page.Explicit assessment criteria are provided, however please note you will also be assessed on the following broad criteria:

○ Meeting functional requirements as described in the exercise description.
○ Demonstrating a solid understanding of object-oriented design and C++ coding, including good practice.
○ Following the unit Programming Style Guide.
○ Creating solutions that are as efficient and extensible as possible.

NOTE! Your submitted program MUST compile and run. Any submission that does not compile will
automatically awarded a 50 marks penalty. This means it is your responsibility to continually
compile and test your code as you build it.

NOTE! Your submitted files must be correctly identified and submitted (as described above). Any
submission that does not comply will receive an automatic 20 marks penalty (applied after
marking). For assignment 3, your Visual Studio project should include all .cpp and .h files.
If you have any questions or concerns please contact your tutor as soon as possible.

Your Major Programming Project

Your first programming project will be submitted in two parts – Part A (assignment 2) is your
Project Plan and Part B (assignment 3) is your C++ implementation of your plan.

Assignment 2 is the first part of a larger project, which you will complete in Assignment 3. The
purpose of this assignment is to get you comfortable with planning the C++ programming for
Assignment 3. You will focus on the planning of the project and the UML diagrams of the game.

In Assignment 3 you will focus on creating the C++ program as outlined in your project plan.
The details for the implementation of your project are covered later in this brief.

Assignment 2 : Project Plan for “Left-Centre-Right” (Part A)

You are to implement a computer-based variant of the dice game “Left, Centre, Right” or “LCR”.

This is a 3 or more player dice game, using 3 custom 6-sided dice and a number of counters or
chips for each player. The aim of the game is to be the only player with counters or chips left. In
this version, you will play against a minimum of two human or computer opponents.

It is recommended that you play the game with some friends several times to learn how the
rules of the game work. This will be essential in helping you plan your project. You can also
watch this video to see how it’s played: https://www.youtube.com/watch?v=LZcsZFbHA1w

Basic Game Play

Players start with a few chips and then take turns rolling the dice to determine which direction
they should pass their chips. The objective of the game is to be the only player with any chips.

Each player starts with 3-5 chips (more chips means a longer game). The “centre” is called the
“pot” and starts with no chips. The starting player is randomly selected, then play continues in
clockwise order.

Each player has a turn to roll the dice and do the required action(s). On your turn:

a. Roll the number of dice based on the number of "chips" you have:
Chips Dice
3+ roll all 3 dice
2 roll only 2 dice
1 roll only 1 die
0 roll no dice
b. You take actions based on what is showing on the dice. If you rolled:
"L" give a chip to the player on the left
"C" put a chip into the pot (centre)
"R" give a chip to the player on the right
"o" nothing happens
For example: If you had 5 chips and rolled "L", "C", "O" you would give 1 chip to the player on 
your left, put 1 chip in the pot, leaving you with 3 chips.
c. After rolling the dice and taking actions, pass the dice to the next player.
d. If you lose all your chip, you are not out of the game, you just don't roll any dice until you
get more chips, as other players may have to give you chips on their turn.

To win the game, you must be the only player with any chips left. The winner also takes the
chips from the pot to add to their score. You usually play a number of games (1 for each player)
with the player having the highest accumulated score being called the overall winner!

Computer Players

You will be expected to automate the process for the computer players. In other words, each
computer player will go through the same process as the human player(s) – showing the results
of the dice rolled and providing feedback to the player(s).

Screen Displays

Displaying relevant information to the player(s) is an important aspect of program design. You
must determine which data is relevant for the player to make informed decisions.
These screenshots show one way in which to display the relevant data to the player.



Requirements and Analysis Document (Project Plan)

Having a clear plan for your project before you begin coding is essential for finishing a successful project on time and with minimal stress. So part of this assessment project is defining what will be in your program and what you need to do to actually develop it.

The documentation you must submit will include the following:

A description of “How to Play”

This will be the information you display on the opening screen of your game to inform the player what they need to do in order to play and win the game. Do not just copy the game play description above, make your own description.
Note: This description can be saved as a text file and read into your game when the program begins. You can also use this as a convenient way to display “help” if the player asks for it.

A development outline of your game

Using a simple outline format (numbered or bullet points) state the main actions that the program will have and then, as sub-points, state the things you will need to do to make that happen.
The outline structure should contain all the elements of your game, as this is a high level description of your approach to the development of your program. You should include at least the following headings and provide examples of what happens under each section.
➢ The game setup
➢ A player’s turn - processing player input and displaying results
➢ The computer’s turn – an automated player turn
➢ The end game conditions
➢ Additional Features included, if any – see Assignment 2
➢ Outline what will be in all your game classes – see Assignment 2
Here is an example to get you started with your project outline:
o The Game Setup
■ Display an overview of the game rule so the player knows what to do to win.
■ Initialise the game elements:
✓ add the players – ask for the player’s name, assign name(s) to the opponent
✓ add any the other things that will happen during initialisation

As you can see, you only have to describe the actions the program will take, not the code, for the outline. The idea here is to give you a starting point for when you start writing your code as you can use this as a checklist of the things you need to include.
● UML Diagrams
UML diagrams are designed to make structuring your program easier. How to create them will be covered in class, but the general structure is shown here – see Assignment 2 for more details about classes.
You will need UML diagrams for each of the classes you include in your game (as least a Player class and the Game application or driver).

ClassName
list of attributes (variables)
list of behaviours (functions)

Assignment 2: Marking Criteria [100 marks in total]

NOTE: Your submitted file must be correctly identified and submitted, otherwise it will receive an automatic 20 marks penalty (applied after marking).

  1. Requirements and Analysis Document [78]
    1.1. Description of the rules (the introduction to your game) [6]
    1.2. Outline includes all game functionality required from Part B [6]
    1.3. Each section is broken into logical tasks [15]
    1.4. Task descriptions provide sufficient detail about the programming processes required [36]
    1.5. Tasks are performed in a logical order [15]

  2. UML Diagrams [22]
    2.1. Correct structure used (Name, Attributes, Behaviours) [6]
    2.2. All variables and functions have meaningful names [16]

    Assignment 3 : Project Implementation for “Left-Centre-Right” (Part B)
    You are to implement the dice game you documented in Assignment 2 by creating an Visual Studio Project and submitting a working version of “Left-Centre-Right” or “LCR”.
    Your completed “Left-Centre-Right” (LCR) dice game must demonstrate the following:
    ● You MUST implement your program using the following classes (as a minimum, you may include more if appropriate):
    ○ Player class: holds the player’s details including their name, player number and score. The class must include an appropriately structured header file.
    ○ Game driver class: hold the main() function and controls the overall flow of the game. This file must also have an appropriate header file.
    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 their current score at the start of their turn
○ roll the correct number of dice, based on the number of “chips” they have ○ quit the game if they want to

● The opponent (computer) player must be able to do the following:
○ be assigned a name at the start of the game and used in the feedback given – if you have multiple human players, names should be requested as per player above
○ automate the process of rolling the dice and displaying the feedback
○ wait for the player to continue (so they have time to read the feedback)

● The dice in the game should have the following characteristics:
○ A custom 6-sided dice is used in this game with the following variations:
■ sides 1, 2 and 3 are replaced with “o” (i.e. nothing happens)
■ side 4 is replaced with Left (L)
■ side 5 is replaced with Centre ©
■ side 6 is replaced with Right ®

● The game must check for the following conditions:
○ All the criteria as stated in the game play description in Assignment 2.
○ The player has run out of chips but there are some left in the game they are not out of the game but are still included in the turn order.
○ All chips are either in the “pot” and/or held by only one player.
○ The human player(s) should be able to QUIT the game at any time.

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 be able to score a maximum of 20% of the marks (a total of 20 marks).
● The player can set the number of chips all players start with (for example 3 or 5, or a random number from 3 to 5). [3]
● The player can choose to play multiple games to determine an overall winner. The number of game set should be equal to the number of players. [3]
● Display the dice using ASCII art using a formatted string. [4]
● Allow the game to be saved and restored at the player’s request. [5]
● Create a Die class to hold all the details of each die. A set of 3 dice are created at the beginning of the game and only the required number of dice are rolled and displayed. [5]
● Introduce a Wild value – side 3 is replaced with Wild (W). If you roll any Wilds on your turn you have these additional actions:
○ rolling 1 Wild allows you to take one chip from any opponent
○ rolling 2 Wilds allows you to take 2 chips from any opponent or take one chip from 2 different opponents
○ rolling 3 Wilds allows you to take all the chips from the centre pot, instantly winning the game
The player must be asked at the beginning of the game if they want to play with Wilds.
[10]
● Allow the player to choose to roll the dice as [N]ormal or to [R]everse the effects from give to take on their turn (this would be a random choice for a computer player). To reverse the effects, the player must pay 3 chips to the “pot” (centre) before they roll the dice.
This means that if you roll an L you take a chip from the player on you left instead of giving them a chip. Similarly, you would take a chip from the player on your right if you rolled an R or one from the “pot” if you rolled a C.
If you are also playing with wilds, this will also effect of the wild actions as well. If you roll 1 or 2 Wilds you give chips to other players, and rolling 3 Wilds you must give all your chips to the “pot”. [10]
You certainly do not have to implement all of the above to earn marks for extra functionality. Just remember the maximum marks you can earn are given in [x]. It is up to you!

Assignment 3: Marking Criteria [up to 100 marks in total]

NOTE: Your submitted project must be correctly identified and submitted, otherwise it will receive an automatic 20 marks penalty (applied after marking).
Does the program compile and run? Yes or No
NOTE! Your submitted program MUST compile and run. Any submission that does not compile will receive an automatic 50 marks penalty (applied after marking).

  1. Class Design [10]
    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. Game Driver Class [5]
    1.2.1. Has an appropriate header file [2]
    1.2.2. Has appropriate variables and functions using meaningful names [2]
    1.2.3. The main() function has appropriate function calls to keep it uncluttered [1]

  2. Functionality [50]
    2.1. Game set up including: creating the required number of players (human and computer) initialising al the player and game variables, displaying the game rules at the start of the game, etc. [10]
    2.2. Implementation of a clear and uncluttered User Interface displaying relevant information [8]
    2.3. Appropriate use of prompt messages to ease the flow of the game and player input
    [5]
    2.4. Implementation of successful action processes [10]
    2.5. Implementation of appropriate responses to player’s interactions [8]
    2.6. Appropriate feedback displayed to the player [4]
    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 [6]
    3.1.2. Appropriate use of data types [3]
    3.1.3. Appropriate use of decisions, loops and other programming techniques [3]
    3.2. Has a well-designed OO program been implemented? [4]
    3.3. Has the Programming Style Guide been followed appropriately? [4]

  4. Extra Functionality [20]
    ● The player can set the number of chips each player starts with [3]
    ● The player can choose to play multiple games to determine an overall winner [3]
    ● Display the dice using ASCII art using a formatted string [4]
    ● Allow the game to be saved and restored at the player’s request [5]
    ● Create a Die class to hold the details of and manipulate each die [5]
    ● Allow the game to include the use of Wild values and options [10] ● Allow the player to choose Normal or Reverse dice effects [10]

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.

51作业君

Email:51zuoyejun

@gmail.com

添加客服微信: abby12468