Skip to content
Sign UpLog In
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs

How to move to a certain line in the program?


If the user inserts a different word that is not "punch" or "defend", I would like the message to pop up and then it should repeat the question at the start (line 17) - "What would Player1 like to do?"

Currently the whole game ends if you misspell a word or don't type in the correct words.

Also I think there might even be a more compact way of doing this - maybe using cases?

(btw I haven't finished the game so there's a different error that comes up stating that I haven't used the variable player1)


2 years ago
You are viewing a single comment. View All
while (true) { if (... user did a good command) { break; } else { ... do nothing/warn ... } } ... more code ...

I think C# has goto statements too, but goto is bad

2 years ago