The following code randomly selects a square from a global list and eliminates it from the list once it has been selected, so that the program does not select the same square again, as well as check if any squares are empty.
However I have a problem in terms of getting the program to fill the selected square with a colour, I have tried everything but seem to get nowhere
Thanks in advance
on keydown
global gList
vMax = gList.count
if not vMax then
exit
end if
vIndex = random(vMax)
vSquare = gList[vIndex>
gList.deleteAt(vIndex)
if the keypressed="A" then vColour = rgb(255,0,0)and vColour=vSquare
else
if the keypressed="B" then vColour = rgb(255,128,0)and vColour=vSquare
end if
end if
end keyDown
