Question: PLEASE IN C NOT JAVA OR C + + PLEASE ADD ALL THE REQUIRED FUNCTIONS LISTED Overview: The rand ( ) function is a random
PLEASE IN C NOT JAVA OR C
PLEASE ADD ALL THE REQUIRED FUNCTIONS LISTED
Overview: The rand function is a random number generator in C that returns a value in a specified range from max The value returned by rand function is based off a seed value that is passed into srand function, which determines the pseudorandom
o numbers generated. Restrictions:
You may not use any global variables.
Summary of DungeonCubeCaesar:
The game of DungeonCubeCaesar is a twoplayer game. A random fiveletter word is generated and the number of sides for the two dices used in the game are determined. Players one and two each take turns to roll two nside dices. Whichever player's sum of their dice roll is less than the other players, they gain a letter of the randomly generated word. They can also lose an accumulated character if they roll the highest value from both dices. The game repeats until one player accumulates five letters of the randomly generated word and declares as the loser. Afterwards, the losing player with all five letters of the randomly generated word encrypts the word resulting in the end of the game.
DungeonCubeCaesar Game Rules:
DungeonCubeCaesar is a twoplayer game where player one is a human player and player two is a nonhuman player whose name is Bob.
Upon the game beginning, a welcome message gets displayed.
Player one then gets asked to enter a seed value used for the game's duration.
o The seed input may only contain numerical characters.
o The seed entered must contain at least one numerical character and must be in the range of
o If at least one of these conditions is not satisfied, then the player must be prompted again to enter a valid seed until they do so
o Once a valid seed is entered, this seed value is passed to the srand function only once.
Next, a fiveletter word to be used in the game is randomly generated.
o The randomly generated word must only contain lowercase alphabetical characters
Next, player one is asked to enter their name to be used within the game.
o The name that the player enters must be at least two characters and no longer than characters. The name must only contain alphabetical characters.
o If at least one of these conditions is not satisfied, then the player must be prompted again until their name satisfies the criteria specified.
Next, player one is asked to enter the number of sides for each of the two dices to be used in the game.
o A valid input for this prompt follows the format #x# where the user will enter a single numerical character for the number of the sides for each of the two dices. The values entered must be in the range between
If either of the sides of the dice specified are not within the valid range, then the user must be prompted again until they enter a valid input. o Valid sample inputs for the sides of the two dice are as follows: xx x x
There may be any number of whitespaces in between the characters, which you need to handle accordingly when determining the sides of each of the dice
Afterwards, the game begins with player one rolling the two dices with the indicated sides followed by player two rolling the two dices.
o A player with the sum of their dice rolls less than the other player gains a character of the randomly generated word.
The sum of each players dice rolls must be kept track of The losing players sum will be utilized in the ciphering at the end of the game.
o Any players with the sum of their dice rolls equal to the maximum dice roll possible will have the last accumulated character removed assuming they have at least one character accumulated, otherwise nothing happens
The game repeats until a loser accumulated the five letters from the randomly generated word.
On each round: o Display the current round starting from round
o Display the sum of dice rolls of player one and player two.
o Display the accumulated letters for each player at the end of each round
o Once a losing player is chosen, display which player lost and then subsequently display their encrypted word using a cipher.
The game ends afterwards.
Required functionsin addition to main:
int validseed;void generateword;int rolldice;int validatesides;int validateplayername;void cipher;
Sample output highlighted text indicates user input:
Please enter a seed value to be used in the game:
The randomly generated word is: rlpal
Please enter your name: Joe
Please enter a valid player name: Kled
Please enter the sides of two dice: x
Round starting now!
Kled is rolling the dice now!
Kled rolled a Bob is rolling the dice now!
Bob rolled a
Kled's word is:
Bob's word is:
Round starting now!
Round starting now!
Kled is rolling the dice now!
Kled rolled a
Bob is rolling the dice now!
Bob rolled a
Kled's word is: rlpal
Bob's word is: r
Kled has lost the game!
Their encrypted word is lfjuf
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
