ajetrumpet
Banned
- Local time
- Today, 16:28
- Joined
- Jun 22, 2007
- Messages
- 5,638
Folks,
I have about 1200 lines of code in a module to play a game I have created in Access. The code is checking to see weather a user has colored the right number of pictures the right color(s). Initially, this code was not in the game, but what I found without it, was that if a user was correct with their answer, but colored the pictures in the wrong order from what the voice instructions' order was, it would tell the user that the answer was incorrect. I know I need this code, but I am looking for some kind of looping consolidation here, if someone cares to take a crack at it. Thanks!
PlayType is the number of random figures being colored with randomly chosen colors:
I have about 1200 lines of code in a module to play a game I have created in Access. The code is checking to see weather a user has colored the right number of pictures the right color(s). Initially, this code was not in the game, but what I found without it, was that if a user was correct with their answer, but colored the pictures in the wrong order from what the voice instructions' order was, it would tell the user that the answer was incorrect. I know I need this code, but I am looking for some kind of looping consolidation here, if someone cares to take a crack at it. Thanks!
PlayType is the number of random figures being colored with randomly chosen colors:
Code:
Select Case PlayType 'DETERMINE IF THE ANSWER IS CORRECT USING
THE 'CORRECTSELECT' VARIABLE HERE
Case Is = 1
If SelectedPict1 = Figure1 And SelectedColor1 = FigColor1 Then
CorrectSelect = True
Else
CorrectSelect = False
End If
Case Is = 2
If (SelectedPict1 = Figure1 And SelectedColor1 = FigColor1 _
And SelectedPict2 = Figure2 And SelectedColor2 = FigColor2) Or _
(SelectedPict1 = Figure2 And SelectedColor1 = FigColor2 _
And SelectedPict2 = Figure1 And SelectedColor2 = FigColor1) Then
CorrectSelect = True
Else
CorrectSelect = False
End If
Case Is = 3
If (SelectedPict1 = Figure1 And SelectedColor1 = FigColor1 _
And SelectedPict2 = Figure2 And SelectedColor2 = FigColor2 _
And SelectedPict3 = Figure3 And SelectedColor3 = FigColor3) Or _
(SelectedPict1 = Figure1 And SelectedColor1 = FigColor1 _
And SelectedPict2 = Figure3 And SelectedColor2 = FigColor3 _
And SelectedPict3 = Figure2 And SelectedColor3 = FigColor2) Or _
(SelectedPict1 = Figure3 And SelectedColor1 = FigColor3 _
And SelectedPict2 = Figure2 And SelectedColor2 = FigColor2 _
And SelectedPict3 = Figure1 And SelectedColor3 = FigColor1) Or _
(SelectedPict1 = Figure2 And SelectedColor1 = FigColor2 _
And SelectedPict2 = Figure1 And SelectedColor2 = FigColor1 _
And SelectedPict3 = Figure3 And SelectedColor3 = FigColor3) Or _
(SelectedPict1 = Figure2 And SelectedColor1 = FigColor2 _
And SelectedPict2 = Figure3 And SelectedColor2 = FigColor3 _
And SelectedPict3 = Figure1 And SelectedColor3 = FigColor1) Or _
(SelectedPict1 = Figure3 And SelectedColor1 = FigColor3 _
And SelectedPict2 = Figure1 And SelectedColor2 = FigColor1 _
And SelectedPict3 = Figure2 And SelectedColor3 = FigColor2) Then
CorrectSelect = True
Else
CorrectSelect = False
End If
End Select
Last edited: