loop through a list

jherman

New member
Joined
May 28, 2020
Messages
1
Programming Experience
Beginner
Hello i am doing a school programing prodject and i am a beginner. We are supposted to make a vocabulary test where you can enter two words that mean the same thing and then press test, the program should then display one word and your supposed to fill in the other one. then it is supposted to check if the word matches the one you saved when you added the words to the list this is my code so far::
C#:
count = 0;
point = 0;

if (count< gloslista.Count) // gloslista is my list with the words
{
    if (engsvar == gloslista[count].Englosa.ToLower()) // engsvar is the word that you are putting in.
    {
        txtsvenska.Clear();
        txtengtest.Clear();
        MessageBox.Show("answer right");
        points++;
    }
    else
    {
        MessageBox.Show("answer wrongl");
        txtsvenska.Clear();
        txtengtest.Clear();
    }
    
    count++;
    txtsvenska.Text = gloslista[räkna].Svglosa;
    txtSv.Text = rättsvar.ToString();
}
else
{
    MessageBox.Show("you have this many pints " + rättsvar);
}
 
Last edited by a moderator:

jmcilhinney

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
3,210
Location
Sydney, Australia
Programming Experience
10+
This is what you just posted:
I'm supposed to do something. Here's my code.
Don't you think there's something missing there? An explanation of the problem you are presumably having, perhaps?
 
Top Bottom