How to keep a word until conditions are met? Suggestions? It's in code playground if you need a better idea what I'm asking. | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

How to keep a word until conditions are met? Suggestions? It's in code playground if you need a better idea what I'm asking.

static string GetWord() { int[] num = new int[3]{0, 1, 2}; Random random = new Random(); int getWord = num[random.Next(num.Length)]; string[] wordList = new string[]{ "bitch", "arson", "trope" }; return wordList[getWord]; } static void Main(string[] args) { SO! When this gets called in main it will create a new word every time. I want it to keep the word until the user guesses it. How?

28th Dec 2016, 7:58 AM
Donny
Donny - avatar
1 Antwort
0
you should put in wich you guess the Word inside of a do-while-loop and copare the Input-string to the word
28th Dec 2016, 10:30 AM
Florian