As I said I am having trouble with a program I am writing, the code is below i am writing a program where who ever picks up the last ball loses. I am trying to make this unbeatable but the only way i can think of is to make the Computer cheat and take 4 instead of the maxium of 3. How can I make it so that the player will always be the last one to pick up the ball. There are 25 balls and you can only up 1 to 3. this is the code for the computer to go.
Code:cguess = Int(Rnd * 10) + 1 If amountleft = 1 Then LBLwinner.Caption = "Player Wins" pwins = pwins + 1 LBLpw(0).Caption = pwins Else If amountleft > 15 Then Select Case cguess Case 1 To 2 amount = 1 Call cscore Case 3 To 4 amount = 2 Call cscore Case 5 To 10 amount = 3 Call cscore End Select ElseIf amountleft > 6 And amountleft < 15 Or amountleft = 15 Then Select Case cguess Case 1 To 3 amount = 1 Call cscore Case 4 To 7 amount = 2 Call cscore Case 8 To 10 amount = 3 Call cscore End Select ElseIf amountleft = 6 Then amount = 1 Call cscore ElseIf amountleft = 5 Then amount = 4 Call cscore ElseIf amountleft = 4 Then amount = 3 Call cscore ElseIf amountleft = 3 Then amount = 2 Call cscore ElseIf amountleft = 2 Then amount = 1 Call cscore ElseIf amountleft = 1 Then amount = 1 Call cscore End If End If




Reply With Quote