k, i have this and it draws 20 numbers 1 through 80..
ACT Room_3,X PAlib bool used[80]
ACT Room_3,X PAlib int randomnumbers[20]
ACT Room_3,Declare Global finished;Boolean (true/false);0
ACT Room_3,Declare Global loop;8-bit Unsigned;0
ACT Room_3,Declare Global random;8-bit Unsigned;0
ACT Room_3,Do Just once
ACT Room_3,While loop != 20
ACT Room_3,While !finished
ACT Room_3,Set Variable random;PA_RandMinMax(1,80)
ACT Room_3,Immediate If !used[random];finished = 1
ACT Room_3,Set Variable used[random];1
ACT Room_3,End While
ACT Room_3,Set Variable finished;0
ACT Room_3,Set Variable randomnumbers[loop];random
ACT Room_3,Draw Variable 1;0;loop;random
ACT Room_3,Set Variable loop;loop+1
ACT Room_3,End While
ACT Room_3,Set Variable loop;0
however.. what i want it to do now is if let's just say for argument sake that the number "1" was drawn in any of the 20 numbers drawn that something happens.. i tried the following and none work:
A:ACT Room_3,If (randomnumbers[0]== 1 || randomnumbers[1]== 1 || randomnumbers[2]== 1 || randomnumbers[3]== 1 || randomnumbers[4]== 1 || randomnumbers[5]== 1 || randomnumbers[6]== 1 || randomnumbers[7]== 1 || randomnumbers[8]== 1 || randomnumbers[9]== 1 || randomnumbers[10]== 1 || randomnumbers[11]== 1 || randomnumbers[12]== 1 || randomnumbers[13]== 1 || randomnumbers[14]== 1 || randomnumbers[15]== 1 || randomnumbers[16]== 1 || randomnumbers[17]== 1 || randomnumbers[18]== 1 || randomnumbers[19]== 1) && PA_GetSpriteAnimFrame(0,0) == 80
ACT Room_3,Set Sprite Frame 0;0;160
ACT Room_3,Set Variable hits;hits + 1
ACT Room_3,Else If PA_GetSpriteAnimFrame(0,0) == 0
ACT Room_3,Set Sprite Frame 0;0;240
ACT Room_3,End If
B:ACT Room_3,Loop i,1,80
ACT Room_3,If randomnumbers[i]== 1 && PA_GetSpriteAnimFrame(0,0) == 80
ACT Room_3,Set Sprite Frame 0;0;160
ACT Room_3,Set Variable hits;hits + 1
ACT Room_3,Else If PA_GetSpriteAnimFrame(0,0) == 0
ACT Room_3,Set Sprite Frame 0;0;240
ACT Room_3,End If
ACT Room_3,End Loop
basically i'm making a KENO game, and as i mentioned for arguments sake that if "1" was drawn in any of the 20 numbers AND if "1" was selected on the board then change the YELLOW 1 to a green 1, otherwise if the 1 was not selected on the board but was drawn in the 20 numbers then change the BLUE 1 to a RED one..
at the moment, the YELLOW 1 changes to a GREEN 1 even if it's not one of the 20 numbers drawn or to a RED 1 if it was drawn but not selected on the board.. no matter what code i put in there - it's not doing exactly what i want it to do


- keno1.PNG (17.54 KiB) Viewed 1019 times