Posted by: programmervb on: May 12, 2008
Cls
Screen 9,,0,0
Randomize timer
Dim unit(20,10)
Dim bloc(20,10)
Dim terra.incognita(100,100)
Dim memoire.colec(100,2)
Restore robots
For i=1 to 20
Read unit(i,1),unit(i,2),unit(i,3),unit(i,5)
Next i
Restore terrain
For i=1 to 20
Read bloc(i,0),bloc(i,1),bloc(i,2)
Next i
Gosub affichage
Input “Combien de tours “;a
Cls
For t=0 To a
Gosub affichage
Screen 9,,1,0
Gosub affichage
Screen 9,,0,1
Delay .15
Gosub effacage
Screen 9,,1,0
Gosub effacage
Gosub comportement
Gosub affichage
Screen 9,,0,1
Next t
End
effacage:
For i=1 to 20
For j=1 to 20
Line (unit(i,1)*6,unit(i,2)*4)-(unit(i,1)*6+5,unit(i,2)*4+3),7,bf
Next j
Next i
Return
affichage:
For i=1 to 20
Line (unit(i,1)*6,unit(i,2)*4)-(unit(i,1)*6+5,unit(i,2)*4+3),unit(i,3),bf
Line (memoire.colec(i,1)*6,memoire.colec(i,2)*4)-(memoire.colec(i,1)*6+5,memoire.colec(i,2)*4+3),memoire.colec(i,0),bf
Next i
Return
comportement:
For i=1 [...]