use array to store radnom sequence in array (w5,h2), to store keys pressed, and to compare them
gvar - npress
on (sommething)
+for "i" from 0 to 4 => set at x: loopindex, value round(radndom(1,6))
npress not=5
+ key "1" pressed => set at XY: (npress,2), value: 1
add 1 to npress
+ key "2" pressed => set at XY: (npress,2), value: 2
add 1 to npress
...
npress=5
+ compare at x,y - (comapre random sequence and key stored in array) = > do something...
reset radnom sequence...
set npress to 0
I know it's quick and ugly but it may give you general direction...