Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Ive been stuck on this code for a while now so i come to the experts. i am constructing a pig dice game with 2

Ive been stuck on this code for a while now so i come to the experts. i am constructing a pig dice game with 2 human players and every time i try i end up in an infinite loop when the player rolls a 1. I am programming in C++ and here here are the requirements

Construct the game of PIG. Here are the rules:

There are two local players Player 1 will go first It would be very advantageous to use the rand() % 6 + 1 as your dice formula.

Single Die Rules

The player will roll the die repeatedly accumulating points shown on the dies value. The player will continue to roll until satisfied with their score. If the player rolls a 1, they will lose all points earned during that round and their turn ends. The process will repeat until a player is the first to reach 100 points or greater.

Two Dice Rules

The player will roll the dice repeatedly accumulating points shown on the dies value. The player will continue to roll until satisfied with their score. If the player rolls a 1 on either die, they will lose all points earned during that round and their turn ends. If the player rolls snake eyes (double 1s) they will lose all points earned and start back at 0. The process will repeat until a player is the first to reach 100 points or greater.

Our game should contain the following:

2 Player mode - Human controlled player 1 and2 GamemodeA&B-Aissingledie,Bistwodice Use validation if necessary,

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data And Databases

Authors: Jeff Mapua

1st Edition

1978502257, 978-1978502253

More Books

Students also viewed these Databases questions