# INTRODUCTION: Play sorry with two die, and one peg. Move your piece...

## Question

INTRODUCTION: Play sorry with two die, and one peg. Move your piece down the board first. But rolling certain numbers will change the pace of the game.
INCLUDE IN YOUR ASSIGNMENT: Annotation is a major part of any program. At the top of each of your C++ programs, you should have at least four lines of documentation:
// Program name: tictactoe.cpp
// Author: Twilight Sparkle
// Date last updated: 5/26/2016
// Purpose: Play the game of Tic-Tac-Toe

ASSIGNMENT: Sorry Game

1.To play “Sorry”, you’ll need to create up to Four players.
Prompt the user for the number of players (2-4).
2.Create two die for the players to roll.
3.Create an Array to be used as the playing board, having 50 spaces.
With 50 being the winning space.
4.Now the dice have special conditions:
2 = Move two spaces (unless the player is on space #49 then move 1 space)
3 = Move three spaces
4 = Move back one space.
5 = Move five spaces.
6 = Move six spaces.
7 = Swap spots with the leading layer / or nothing if player is in lead.
8 = Move Eight spaces.
9 = Move nine spaces.
10 = Move ten spaces.
11 = Swap spots with the last player / or do nothing if player is last.
12 = Start Over

5. A player must roll a double to start. When on start rolling a double of 4 or 12 results in moving one space off start otherwise move the value of the double that was rolled.
6. If a player lands on the same space as another, the other player must return to the beginning.
Example: If P1 lands on a space where P3 is, P3 would go back to the start.
7. A player must roll an EXACT number to enter the winning space (with the exception of space #49).
8. Use a random Generator to “roll” the dice, the user must press enter to roll.
9. Once a player finishes, create a winning message announcing the winner.
10. Then ask the user if they would like to play again.
11. You must use at least three functions. Some function examples could be:
Roll dice, check for other player (when moving), display board.
12. Display the status/location of the players between sets of rolls.
13. Depict a Playing Board on the screen and display the Players’ position on the board. (Extra)
(maybe try using a method to create the board and screen each time a player moves)
14. If a player rolls a double, they’ll get another roll (Extra).
15. If a player rolls two doubles in a row, they Start Over (Extra).

## Solution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

#include <cstdlib>
#include <iostream>
#include <ctime>
#include <string>
#include <cmath>
#include <valarray>
using namespace std;

// constant values
const int BOARD_LENGTH = 50;
const int EMPTY = -1;
const int MAX_PLAYER_NUM = 4;
const int START = -1;
const int GAMEOVER = 1;
const int CONTINUE = 0;

// function prototype

/**
* get number of player
* @return
*/
int getUserNum();
/**
* roll a dice
* @param order the rolling order
* @return a dice value
*/
int rollDice(int order);

/**
* set al cell of board to empty
* @param board
*/
void initBoard(int board[]);
/**
* show the board
* @param board
*/
void displayBoard(int board[]);

/**
* put all player to the stat point
* @param positions
*/
void initPlayerPosition(int positions[]);

/**
* find the last player on the road
* @param positions list of player position
* @return the last player
*/
int findLast(int positions[]);
/**
* @param positions list of player position
*/

By purchasing this solution you'll be able to access the following files:
Solution.cpp.

\$36.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

### Find A Tutor

View available Gaming and Simulation Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.