0
Help xD
I have made a short game program with the help of the community codes but I am having trouble creating a restart option if the character dies I got a while loop going when the character has health and when it becomes false it returns the score and a short message about Dying followed by the option do you wish to continue how do I implement or get it to read the next line eg. string restart == console.readline(); If (Restart == yes || restart == y) { // also what do I put here to restart // } Else Break;
10 Respuestas
+ 4
Put a second while loop around your existing code.
+ 4
I made a few different changes. You had the restart in the wrong place. You forgot to reset the players stats on restart.
https://code.sololearn.com/c18Oo511500b
+ 2
string restart = "y";
while (string.compare(restart, "y")) {
// existing code
restart = console.readline();
}
+ 1
thank you
+ 1
line 123 needs to return the string returned by the recursive call to pass it up.
+ 1
thank you
+ 1
thank you so much
0
how do i get it to activate the second while loop only if they answer yes
0
i have messed up somewhere my startTurn() is no longer returning a value
this may be easier here is my code can you have a look please would greatly appreciate it
https://code.sololearn.com/cWppqxcEH02C
0
error CS0117: 'string' does not contain a definition for 'StartTurn'
error CS0161: 'Game.StartTurn()': not all code paths return a value