Ti80.Online

Pour plus de programmes...
http://www.ti80.online.fr
ti80@citeweb.net
-----------------------------------

Démineur pour ti80

@ c'est théta : ALPHA 3

:CLRHOME
:DISP "CONTINUER","NOUVELLE PARTIE"
:INPUT "(1/0)",X
:IF X=1:Then
:CLRHOME
:GOTO A
:End
:CLRDRAW
:INPUT "NOMBRE DE MINES:",R
:1->XMIN
:1->YMIN
:1->^x (^x : VARS, WINDOW, 7)
:1->^y (^y : VARS, WINDOW, 8)
:0->XSCL
:0->YSCL
:FNOFF
:CLRDRAW
:DISPGRAPH
:FOR(X,0,10)
:VERTICAL X6+2
:HORIZONTAL X6+5
:END
:FOR(X,0,5)
:HORIZONTAL X
:END
:VERTICAL 1
:VERTICAL 63
:0->DIM L6
:70->DIM L6
:R->N
:LBL @
:RANDINT(0,9)->A
:RANDINT(0,6)->B
:L6(A+10B+1)->@
:IF @=0:THEN:1->L6(A+10B+1)
:N-1->N:END
:IF N>0:GOTO @
:70-R->@
:LBL A
:INPUT
:INT ((X-3)/6)->X
:INT ((Y-6)/6)->Y
:0->E
:IF X>9:GOTO A
:IF X<0:GOTO A
:IF Y>6:GOTO A
:IF Y<0:GOTO A
:IF L6(X+10Y+1)=2:GOTO A
:IF L6(X+10Y+1)=0:THEN
:0->W
:FOR(T,X-1,X+1)
:FOR(U,Y-1,Y+1)
:0->E
:IF T>9:GOTO Z
:IF U>6:GOTO Z
:IF T<0:GOTO Z
:IF U<0:GOTO Z
:(L6(T+U10+1)=1)+W->W
:LBL Z
:END
:END
:ELSE
:FOR(X,0,9)
:FOR(Y,0,6)
:IF L6(X+10Y+1)=1:THEN
:PT-ON(6X+3,6Y+9)
:PT-ON(6X+3,6Y+7)
:PT-ON(6X+7,6Y+9)
:PT-ON(6X+7,6Y+7)
:PT-ON(6X+6,6Y+10)
:PT-ON(6X+6,6Y+6)
:PT-ON(6X+4,6Y+6)
:PT-ON(6X+4,6Y+10)
:END:END:END
:DISP "TU EST MORT":STOP
:END
:W->N
:LBL Y
:FO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