Question: c language assignment Stage 1 0 Add code to validate all user input: Would you like to battle a slime [ y | n ]

c language assignment Stage 10
Add code to validate all user input:
Would you like to battle a slime [y|n]?
Sample output:
Would you like to battle a slime [y|n]? p
Please enter either 'y' or 'n'.
Would you like to battle a slime [y|n]? y
Select an action [a|r]?
Sample output:
Select an action [a|r]: z
Please enter either 'a' or 'r'.
Select an action [a|r] a
Continue exploring [y|n]?
Sample output:
Player has 148 HP remaining. Continue exploring? [y|n]? z
Please enter either 'y' or 'n'.
Player has 148 HP remaining. Continue exploring? [y|n]? nStage 10
Add code to validate all user input:
Would you like to battle a slime y|n?
Sample output:
Would you like to battle a slime (y|n)? p
Please enter either 'y' or 'n'.
Would you like to battle a slime [y|n]? y
Select an action [a|r]?
Sample output:
Select an action [a|r]:z
Please enter either 'a' or 'r'.
Select an action a|x a
Continue exploring [y|n]?
Sample output:
Player has 148HP remaining. Continue exploring? [y|n]? z
Please enter either 'y' or 'n'.
Player has 148 HP remaining. Continue exploring? [y|n]? n
Stage 11- THIS IS IMPORTANT!
Finally, check the sample output (see section titled 'Sample Output') and if necessary, modify your code so
that:
The output produced by your program EXACTLY matches the sample output provided. (aside from random
damage values)
Your program EXACTLY behaves as described in these specs and the sample output provided.
Stage 12
Now that you know your code is working - why not add code that will allow more randomness between runs. Do this
at the end so you can debug things easily. If you find a bug later on, you may want to temporarily remove this
randomness to make the bug easier to fix.
 c language assignment Stage 10 Add code to validate all user

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!