Ti80.Online

Pour plus de programmes...
http://ti80.ctw.net
ti80@citeweb.net
-----------------------------------

Il y a trois bateaux, disposés aléatoirement au début du jeu.
On perd au bout de 35 coups si on n'a pas détruit la flotte ennemie : Choississez une case, puis ENTER : si vous touchez, un + apparait, sinon c'est /

Envoyé par Julien Richard-Foy

PROGRAM:NAVALE
:CLRHOME
:PLOTSOFF
:CLRDRAW
:FNOFF
:0=>XMIN
:8=>XMAX
:1=>XSCL
:0=>YMIN
:9=>YMAX
:1=>YSCL
:0=>E
:0=>F
:DISP "","","","BATAILLE NAVALE"
:PAUSE
:CLRHOME
:DISP "","","","Mise en place","des navires..."
:LBL ¤ (¤ = Têta)
:RANDINT(0,5=>A
:RANDINT(1,8=>B
:RANDINT(0,7=>C
:RANDINT(1,6=>D
:RANDINT(0,6=>G
:RANDINT(1,8=>H
:IF H=B
:GOTO ¤
:IF G=C
:GOTO ¤
:IF G+1=C
:GOTO ¤
:IF B=D
:GOTO ¤
:IF D+1=B
:GOTO ¤
:IF D+2=B
:GOTO ¤
:FOR(Z,0,8
:VERTICAL Z
:END
:FOR(Z,0,9
:HORIZONTAL Z
:END
:SHADE(0,1,1
:LBL 1
:IF E=8
:GOTO 4
:F+1=>F
:IF F=36
:GOTO 5
:INPUT
:IPART X=>X
:IPART Y=>Y
:IF Y=B
:THEN
:IF X=A
:GOTO 2
:IF X=A+1
:GOTO 2
:IF X=A+2
:GOTO 2
:END
:IF X=C
:THEN
:IF Y=D
:GOTO 2
:IF Y=D+1
:GOTO 2
:IF Y=D+2
:GOTO 2
:END
:IF Y=H
:THEN
:IF X=G
:GOTO 2
:IF X=G+1
:GOTO 2
:END
:GOTO 3
:LBL 2
:E+1=>E
:LINE(X+.5, Y, X+.5, Y+1
:LINE(X, Y+.5, X+1, Y+.5
:GOTO 1
:LBL 3
:LINE(X, Y, X+1, Y+1
:GOTO 1
:LBL 4
:69!
:CLRHOME
:DISP "","",""," GAGNÉ !"
:PAUSE
:GOTO 6
:LBL 5
:CLRHOME
:DISP "","",""," PERDU..."
:PAUSE
:GOTO 6
:LBL 6
:CLRDRAW