I am making a primary school maths game as part of a uni assessment. I am pretty bad with visual basic and tend to do everything the long way. Here is how i am trying to do it ATM:
Dim count As Integer = 0
Dim score As Integer = 0
If number1 + number2 = Val(TextBox3.Text) Then
count = count + 1
score = count
End If
If number3 + number4 = Val(TextBox4.Text) Then
count = count + 1
score = count
End If
If number5 + number6 = Val(TextBox7.Text) Then
count = count + 1
score = count
End If
If number7 + number8 = Val(TextBox10.Text) Then
count = count + 1
score = count
End If
If number9 + number10 = Val(TextBox13.Text) Then
count = count + 1
score = count
End If
If number11 + number12 = Val(TextBox28.Text) Then
count = count + 1
score = count
End If
If number13 + number14 = Val(TextBox25.Text) Then
count = count + 1
score = count
End If
If number15 + number16 = Val(TextBox22.Text) Then
count = count + 1
score = count
End If
If number17 + number18 = Val(TextBox19.Text) Then
count = count + 1
score = count
End If
If number19 + number20 = Val(TextBox16.Text) Then
count = count + 1
score = count
End If
TextBox31.Text = score
I know this is totally wrong and it isnt working, is anyone able to help please? Any aSSISTANCE WOULD BE GREATLY APPRECIATED
Dim count As Integer = 0
Dim score As Integer = 0
If number1 + number2 = Val(TextBox3.Text) Then
count = count + 1
score = count
End If
If number3 + number4 = Val(TextBox4.Text) Then
count = count + 1
score = count
End If
If number5 + number6 = Val(TextBox7.Text) Then
count = count + 1
score = count
End If
If number7 + number8 = Val(TextBox10.Text) Then
count = count + 1
score = count
End If
If number9 + number10 = Val(TextBox13.Text) Then
count = count + 1
score = count
End If
If number11 + number12 = Val(TextBox28.Text) Then
count = count + 1
score = count
End If
If number13 + number14 = Val(TextBox25.Text) Then
count = count + 1
score = count
End If
If number15 + number16 = Val(TextBox22.Text) Then
count = count + 1
score = count
End If
If number17 + number18 = Val(TextBox19.Text) Then
count = count + 1
score = count
End If
If number19 + number20 = Val(TextBox16.Text) Then
count = count + 1
score = count
End If
TextBox31.Text = score
I know this is totally wrong and it isnt working, is anyone able to help please? Any aSSISTANCE WOULD BE GREATLY APPRECIATED