philippe229 / risk Goto Github PK
View Code? Open in Web Editor NEWRisk game with CLI
Risk game with CLI
Check project handout
Description
Integrate polymorphism to player class to support AI
Acceptance Criteria
(Extension of Part1 of Assignment 3) Add 2 more computer strategies (you should then have a total of 4 different computer strategies). These strategies must be designed so that they have a chance to win the game (e.g. the “benevolent” strategy in assignment 3 cannot win a game).
A tournament starts with the user choosing M = 1 to 5 different maps, P = 2 to 4 different computer players strategies, G = 1 to 5 games to be played on each map, D = 10 to 50 maximum number of turns for each game. A tournament is then automatically played by playing G games on each of the M different maps between the chosen computer player strategies. In order to minimize run completion time, each game should be declared a draw after D turns. Once started, the tournament plays all the games automatically without user interaction. At the end of the tournament, a report of the results should be displayed, e.g.
M: Map1, Map2, Map3
P: Aggressive, Benevolent, Random, Cheater.
G: 4
D: 30
Game 1 | Game 2 | Game 3 | Game 4 | |
---|---|---|---|---|
Map 1 | Agressive | Random | Cheater | Cheater |
Map 2 | Cheater | Draw | Cheater | Aggressive |
Map 3 | Cheater | Agressive | Cheater | Draw |
Create the Deck and Hand class and everything needed by it, this includes the DeckAndHandDriver.
Create the Dice class and everything needed by it, this includes the DiceDriver.
Create the Player class and everything needed by it, this includes the PlayerDriver.
Using the Observer design pattern, implement a view that displays some useful statistics about the game, the minimum being a “players world domination view” that shows using some kind of bar graph depicting what percentage of the world is currently being controlled by each player.
This should dynamically be updated as the map state changes and be visible at all times during game play.
Provide a group of C++ classes that implements the main game loop following the official rules of the game of
Risk. During the main game loop, proceeding in a round-robin fashion as setup in the startup phase, every player
is given the opportunity to do each of the following actions during their turn:
Provide a group of C++ classes that implements the startup phase following the official rules of the game of Risk.
This phase is composed of the following sequence:
Provide a group of C++ classes that implement a user interaction mechanism to start the game by allowing the
player to 1) select a map from a list of map files as stored in a directory 2) select the number of players in the
game (2-6 players). The code should then use the map loader to load the selected map, create all the players,
assign dice rolling facilities to the players, create a deck of cards, and assign an empty hand of cards to each
player. You must deliver a driver that demonstrates that 1) different valid maps can be loaded and their validity is
verified (i.e. it is a connected graph, etc), and invalid maps are rejected without the program crashing; 2) the right
number of players is created, a deck with the right number of cards is created.
Self explanatory
Create the Map class and everything needed by it, this includes the MapDriver.
Description
Modify phases to support AI. AI will send data to phase method and receive data from phase method. Remove output when player type is AI.
Acceptance Criteria
Additional Information
dependant on issue #38
Using the Observer design pattern, implement a view that displays information happening in the current phase.
It should first display a header showing what player and what phase is currently being played, e.g. “Player 3: Attack phase” or “Player 1: Fortification phase” Then it should display important information related to what is happening in this phase, which should be different depending on what phase is being played.
This should dynamically be updated as the game goes through different players/phases and be visible at all times during game play.
Additional Information
dependant on issue #39
Provide a group of C++ classes that implement the reinforcement phase following the official rules of the game of
Risk. In the reinforcement phase, the player gets a number of armies (A) to place on its countries, where A is:
Number of countries owned on the map, divided by 3 (rounded down), with a minimum of 3.
Continent-control value of all continents totally controlled by that player.
Armies resulting in card exchange, if possible. If a player owns more than 5 cards, it must exchange
cards (exchanging cards should be done inside the Hand’s exchange() method).
The player must then place all these armies on some of the countries it owns, as it sees fit (for now, it does not
matter which). You must deliver a driver that demonstrates that 1) a player receives the right number of armies in
the reinforcement phase (showing different cases); 2) the player has effectively placed this exact number of new
armies somewhere on the map by the end of the reinforcement phase.
(Extension of Part 3 of Assignment 3) Using the Observer design pattern, implement a view that displays some useful statistics about the game as it is being played. This should dynamically be updated as various aspect of the game state changes and be visible at all times during game play. Using the Decorator pattern, provide different decorators that add more information to be displayed on the Basic (undecorated) Game Statistics Observer:
You must be able to demonstrate that the Basic (undecorated) Game Statistics Observer is available at all times during play and updates the view when the turn number increases. Before the beginning of every turn, the user should be given the opportunity to add one or more Decorators (2, 3, or 4) above, which should result in the Observer to show more information and be notified as instructed above for each Decorator. Each Decorator (2,3,4) should not be used more than once. The user should also be allowed to remove Decorators. The user should be allowed to specify that it does not want to add/remove Decorators in the future, after which the user shall not be prompted anymore at the beginning of every turn.
Create the Map Loader class and everything needed by it, this includes the MapLoaderDriver.
Provide a group of C++ classes that implement the attack phase following the official rules of the game of Risk. In
this phase, the player is allowed to declare a series of attacks to try to gain control of additional countries, and
eventually control the entire map. The attack phase follows the following loop:
The player decides if it will attack or not. If not, the attack phase is over.
The player selects one of its countries to attack from, and one of the neighbors of this country to attack
(i.e. the attacked country belongs to another player). The attacking country must have at least 2 armies
on it.
The attacker and defender players choose the number of dice to roll for their attack/defense. The attacker
is allowed 1 to 3 dice, with the maximum number of dice being the number of armies on the attacking
country, minus one. The defender is allowed 1 to 2 dice, with the maximum number of dice being the
number of armies on the defending country.
The dice are rolled for each player and sorted, then compared pair-wise. For each pair, the player with
the lowest roll loses one army. If the pair is equal, the attacker loses an army.
If the attacked country runs out of armies, it has been defeated. The defending country now belongs to
the attacking player. The attacker is allowed to move a number of armies from the attacking country to the
attacked country, in the range [1 to (number of armies on attacking country -1)].
The player is allowed to initiate any number of attacks per turn, including 0.
You must deliver a driver that demonstrates that 1) only valid attacks can be declared (i.e. valid attacker/attacked
country); 2) only valid number of dice can be chosen by the attacker/defender; 3) given known dice values, that
the right number of armies are deducted on the attacker/defender; 4) the attacker is allowed to initiate multiple
attacks, until it declares that it does not want to attack anymore.
Using the Strategy design pattern, implement different kinds of players that make different decisions during the reinforcement, attack, and fortification phases.
The kinds of players are:
(1) human player that requires user interaction to make decisions,
(2) an aggressive computer player that focuses on attack (reinforces its strongest country, then always attack with it until it cannot attack anymore, then fortifies in order to maximize aggregation of forces in one country),
(3) a benevolent computer player that focuses on protecting its weak countries (reinforces its weakest countries, never attacks, then fortifies in order to move armies to weaker countries).
Provide a group of C++ classes that implement the fortification phase following the official rules of the game of
Risk. In the fortification phase, the player is allowed to move a number of armies (X) from one of its countries (the
3
source country) to one of its neighbors that it also owns (the target country). X must be in the range [1 to (number
of armies on the source country - 1)]. You must deliver a driver that demonstrates that 1) only valid countries can
be selected as source/target; 2) only a valid number of armies can be moved; 3) the right number of armies is
effectively moved.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.