Click here to Skip to main content
15,891,864 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Your task in this program will be to develop an electronic version of the Sneaky Snacky Squirrel Game.  The rules for the game can be found here, and a video of gameplay can be found here.

You will need to define a Log class for this program, as described in the slides from February 21.

When the program begins, it should ask the user for the number of players (2 to 4).  Then, for each turn, the program should print the current state of the game, as well as indicate whose turn it is.  A keypress will have the user spin the wheel, and the program will indicate the result, and, if necessary, ask for more information.  After the turn is complete, the program will then either move on to the next player, or indicate that a player has won the game.

You must also create the following functions as specified and use them in your main program.  You may create other functions as you see fit.

Function Prototype	Description
long spin()	Simulates a spin of the wheel by returning a number from 0 to 9.
void printState(Log[], long)	Clears the screen and then prints the current state of the game when passed the array of Log objects and the number of players.
char chooseColor()	Asks the user to pick a character representing one of the five colors.  It should validate the letter selected, allowing either upper or lower case letters to be entered.  It should always return the upper case version.
void playTurn(Log[], long, long)	Simulates one turn.  It is passed the array of Log objects, current player, and total number of players.

In addition to the program functioning correctly as described above, you will also be graded on:
•	Using appropriate variable names, data types, and constants
o	Limit globals
o	Declare variables at the beginning of your functions
o	Name constants using all capital letters
•	Using comments appropriately, including header comments
•	Formatting your code appropriately using tabs and blank lines
•	Having user-friendly and well-formatted input and output
•	Appropriate data validation

Additional information:
•	Make sure you understand the above requirements before you begin.  Dr. Thompson can provide any clarifications you need

•	When printing the current state of the game, it should look as follows (depending on the spin result):
 

•	To clear the screen, use the call system("cls")

•	If a player has the opportunity to choose two colors, but only needs one to win, the game should end immediately after they choose the correct color

•	When a player has the opportunity to steal an acorn, the program should make sure they do not choose themselves, but they can choose a player who has no acorns.
o	Any color they choose should be allowed
	If the player they choose does not have that color, they do not get that color, and lose their turn
	If they already have that color, the other player should still lose that color

In order to receive any credit for this assignment, all of the following must be completed:
•	Your Log class should compile and pass all the tests in TestLog.cpp (on eLearn)
•	You main program should compile with no errors and:
o	The spin, printState, and chooseColor functions should be implemented correctly


What I have tried:

THis needs to be in C++. I truly have no clue where to start on this.
Posted
Updated 2-Mar-20 9:47am
v3
Comments
Vaclav_ 2-Mar-20 13:32pm    
Internet and forums, including this one, should not be replacement for education - so your best course of action for " where to start" would be to "ask Dr. Thompson". Assuming he /she is a real educator - most forum participants are not.

Quote:
THis needs to be in C++. I truly have no clue where to start on this.

Have a talk with your teacher. If you really can't device anything, you should think about another job.
You show no attempt to solve the problem yourself, you have no question, your main effort is pasting the requirement, you just want us to do your HomeWork.
HomeWork problems are simplified versions of the kind of problems you will have to solve in real life, their purpose is learning and practicing.

We do not do your HomeWork.
HomeWork is not set to test your skills at begging other people to do your work, it is set to make you think and to help your teacher to check your understanding of the courses you have taken and also the problems you have at applying them.
Any failure of you will help your teacher spot your weaknesses and set remedial actions.
Any failure of you will help you to learn what works and what don't, it is called 'trial and error' learning.
So, give it a try, reread your lessons and start working. If you are stuck on a specific problem, show your code and explain this exact problem, we might help.
Quote:
You will need to define a Log class for this program, as described in the slides from February 21.

Here is an indication of which lesson to reread.
 
Share this answer
 
v2
Not really a solution...
Sorry, I think you are at the wrong place here. I think nobody here is willing to do your homework for you ;)
 
Share this answer
 
You start by reading through the notes and the slides from February 21, as described above. So start by studying the description for each of the functions, and what each should do.

People here will help you with your code when it has problems, but we are not going to do your homework for you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900