forked from CSUF-Computer-Science/project2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChutesAndLaddersGame.cpp
51 lines (43 loc) · 1.95 KB
/
ChutesAndLaddersGame.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//
// ChutesAndLaddersGame.cpp
//
#include <iostream>
#include <string>
#include "ChutesAndLaddersGame.hpp"
#include "GameBoard.hpp"
#include "Player.hpp"
using namespace std;
// TODO: implement the constructor with all your team members
// constructor with the default value of a minimum players
ChutesAndLaddersGame::ChutesAndLaddersGame(int nPlayers) : winner("no winner") {
// TODO: implement this function properly
throw std::logic_error("not implemented yet");
}
// TODO: implement the destructor
// destructor - dequeue players from the queue
ChutesAndLaddersGame::~ChutesAndLaddersGame() {
// TODO: implement this function properly
throw std::logic_error("not implemented yet");
}
// TO DO: implement this function properly
// reset the game - rebuild the list of players
// (i.e., the list should be the same as in the constructor).
// Place all players at the figurative square zero
void ChutesAndLaddersGame::resetGame() {
// TODO: implement this function properly
throw std::logic_error("not implemented yet");
}
// TO DO: implement this function properly
// Play the chutes and ladders until a player reaches the winning square 100
// - Each player takes turn to roll the die and moves to the new square by invoking rollDieAndMove.
// If the new square is outside of the board, the player stays put
// - Player's new position is checked against the game board's checkChutesLadders
// - checkChutesLadders returns a different square if player lands on a chute or a ladder
// - Player's position is then set to the new position as indicated by checkChutesLadders
// If player lands on a chute or a ladder, player slides down or climbs up
// - If player lands on the winning square 100, game is over
// - playGame returns after congratulating and printing the winner's name
void ChutesAndLaddersGame::playGame() {
// TODO: implement this function properly
throw std::logic_error("not implemented yet");
}