- Code: Select all
:ClrHome
:5-A
:DelVar KDelVar Q
:5-G
:1-Z
:1-Y
:ClrAllLists
:{9,17-dim([A]
:Fill(0,[A]
:50-dim(L1
:L1-L2
:Fill(3,L1
:Fill(3,L2
:2-D
:
:While K!=105
:getkey-K
:
:If K
:Then
:If K=24 and D!=2:1-D
:If K=26 and D!=1:2-D
:If K=25 and D!=4:3-D
:If K=34 and D!=3:4-D
:End
:
:If D=1:L2(1)-1-L2(1
:If D=2:1+L2(1-L2(1
:If D=3:L1(1)-1-L1(1
:If D=4:1+L1(1+1-L1(1
:
:If L1(1)=0 or L1(1)=9 or L2(1)=0 or L2(1)=17
:Goto 99
:If 1=[A](L1(1),L2(1
:Goto 99
:1-[A](L1(1),L2(1
:
:If Q!=1
:Then
:Randint(2,15-Z
:Randint(2,7-Y
:1-Q
:If [A](Y,Z)=1:0-Q
:If Q=1:Output(Y,Z,"X
:End
:
:If L1(1)=Y and Z=L2(1
:Then
:A+1-A
:0-Q
:End
:
:L1(1-L1(G
:L2(1-L2(G
:G-1-G
:Output(L1(G+1),L2(G+1),"*
:Output(L1(G),L2(G)," "
:0-[A](L1(G),L2(G
:
:If G=1
:Then
:Output(L1(A),L2(A),"
:0-[A](L1(A),L2(A
:Output(L1(G),L2(G),"*
:A-G
:End
:
:End
:
:Lbl 99
:
:ClrAllLists
:{1,1}-dim([A]
:Disp "PERDU
:Pause
:ClrHome
:Disp "
:Disp "SCORE
:Disp A
:Disp "
:Disp "
:Disp "CREATED BY LOKO
:Pause
:ClrHome
:Output(1,1,"
Bon j'ai vu vite fait le code (pas de goto dans des while !!) mais il est déjà pas mal
Pour l'optimiser encore plus tu peux regarder le topic "astuces z80" en post it de ce salon programmation ^^