Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C# programming: design and implement a program that allows the user to play a version of the dice game Pig against the computer. The

In C# programming:

design and implement a program that allows the user to play a version of the dice game Pig against the computer. The object of the game is to be the first to score 100 points. The user and the computer take turns rolling a pair of dice following these rules:

On a turn each player rolls 2 dice. If no 1 appears, the total of the dice is added to the player's score and the player can choose to roll again or pass the turn to the other player. When the computer does not roll a 1, decide if the computer wants to roll again by generating a random number between 1 and 2. 1 causes the computer to roll again. 2 causes the computer to pass.

If a 1 appears on one of the dice, nothing is added to the player's score and the player's turn is over.

If a 1 appears on both dice, the player's score is reset to 0 and the player's turn is over.

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_2

Step: 3

blur-text-image_3

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

Fundamentals Of Database System

Authors: Elmasri Ramez And Navathe Shamkant

7th Edition

978-9332582705

More Books

Students also viewed these Databases questions

Question

What attracts you about this role?

Answered: 1 week ago

Question

How many states in India?

Answered: 1 week ago

Question

HOW IS MARKETING CHANGING WITH ARTIFITIAL INTELIGENCE

Answered: 1 week ago

Question

Different types of Grading?

Answered: 1 week ago