Question: Create a program that plays Pickup Sticks for 2 human players and call it _sticks.cpp. Create an algorithm for the program before starting to write

Create a program that plays "Pickup Sticks" for 2 human players and call it _sticks.cpp. Create an algorithm for the program before starting to write code.

Your program should behave as follows:

*** Welcome to Pickup Sticks *** Enter name of player 1: David Enter name of player 2: Pam (21) | | | | | | | | | | | | | | | | | | | | | David - How many sticks? 2 (19) | | | | | | | | | | | | | | | | | | | Pam - How many sticks? 3 (16) | | | | | | | | | | | | | | | | David - How many sticks? 4 Sorry David, you must take between 1 and 3 sticks. David - How many sticks? 3 (13) | | | | | | | | | | | | | Pam - How many sticks? 2 
(11) | | | | | | | | | | | David - How many sticks? 3 
(8) | | | | | | | | Pam - How many sticks? 3 (5) | | | | | David - How many sticks? 1 (4) | | | | Pam - How many sticks? 3 (1) | David - How many sticks? 2 Sorry David, only 1 stick(s) left. David - How many sticks? 1 David took the last stick. Pam wins! Play again? y Enter name of player 1: .... Enter name of player 2: .... ... Play again? n *** Thanks for playing Pickup Sticks *** 

Extra credit will be awarded for making the computer play a perfect game... (+3 points).

Be sure to test your program thoroughly so that it behave correctly no matter the number of sticks left or taken.

Document your code thoroughly including block comments at the beginning and in-line comments throughout.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!