First off, here's my code:
I'm trying to make a Yahtzee game, and i've come across a error trying to calculate wether or not a roll is a three of a kind.
For some reason it keeps showing that dice(I) always equals J, which shouldn't happen. Should it? Why does it keep showing this?
Dim DICE(5) DICE(1) = 1 DICE(2) = 2 DICE(3) = 2 DICE(4) = 1 DICE(5) = 5 Global COUNT = 0 Global THREE_OF_A_KIND = False For I = 1 To 5 For J = 1 To 5 If DICE(I) = J COUNT = COUNT + 1 Print COUNT EndIf Next Next If COUNT > 2 THREE_OF_A_KIND = True EndIf If THREE_OF_A_KIND = True Print "ASD" WaitKey() EndIf
I'm trying to make a Yahtzee game, and i've come across a error trying to calculate wether or not a roll is a three of a kind.
For some reason it keeps showing that dice(I) always equals J, which shouldn't happen. Should it? Why does it keep showing this?