vendredi 23 novembre 2018

Randomized word not showing up. C#

I'm making a hangman game. But there is one problem i'm facing. I made a function that chooses the word. But when I check if the word is chosen with a textbox. The word doesn't show up. This is the function that picks a random word to be guessed.

            private void woordLaad()
            {
                var regels = File.ReadAllLines("woorden.csv"); 
                var rnd = new Random();
                var RandomRegelNummer = rnd.Next(0, regels.Length - 1); // 
    takes a random line
                RRwoord = regels[RandomRegelNummer];

                textBox1.Text = RRwoord;

Could you people help me with it?




Aucun commentaire:

Enregistrer un commentaire