Graphics3D 640,480,32,2
SeedRnd MilliSecs()
Dim map(8+3,8+3)
For i=0 To 7
For j=0 To 7
map(i,j)=Rand(1,3)
Next
Next
While Not KeyDown(1)
If KeyHit(57)
i_result = -1
j_result = -1
For i = 0 To 8
For j = 0 To 8
If (map(i,j) = map(i+1,j)) And (map(i+1,j) = map(i+2,j)) Then i_result = i
If (map(i,j) = map(i,j+1)) And (map(i,j+1) = map(i,j+2)) Then j_result = j
If (i_result>=0)
map(i,j)=0 map(i+1,j)=0 map(i+1,j)=0 map(i+2,j)=0
i_result = -1
EndIf
If (j_result>=0)
map(i,j)=0 map(i,j+1)=0 map(i,j+1)=0 map(i,j+2)=0
j_result = -1
EndIf
Next
Next
EndIf
For i=0 To 7
For j=0 To 7
Color (map(i,j)=1)*255,(map(i,j)=2)*255,(map(i,j)=3)*255
Rect i*32,j*32,30,30,1
Next
Next
Flip
Wend