Attention, c'est du lourd:
La syntaxe est la plus basique possible et avec une IA
Progamme MORPION
3897 octets
Programme @MORP
338 octets
voilà, avec un screenshot si possible!
La syntaxe est la plus basique possible et avec une IA
Progamme MORPION
3897 octets
- Code:
:PlotsOff
:FnOff
:AxesOff
:GridOff
:Lbl 0
:0->Xmin
:94->Xmax
:0->Ymin
:62->Ymax
:ClrHome
:ClrDraw
:Menu(">>>>MORPION<<<<<","1 JOUEUR",A,"2 JOUEURS",B,"QUITTER",D
:Lbl A
:Output(5,1,"3 LETTRES MAX
:Disp "NOM DU
:Input "JOUEUR 1:",Str1
:"IA->Str2
:Menu(">>>>>NIVAUX<<<<<","FACILE",1,"NORMAL",2
:Lbl 1
:1->H
:Goto C
:Lbl 2
:2->H
:Goto C
:Lbl B
:Output(5,1,"3 LETTRES MAX
:Disp "NOM DU
:Input "JOUEUR 1:",Str1
:Disp "NOM DU
:Input "JOUEUR 2:",Str2
:DelVar H
:Lbl C
:ClrHome[
:For(A,15,75,20
:For(X,1,3
:Vertical A+X
:End
:End
:For(A,-1,59,20
:For(X,1,3
:Horizontal A+X
:End
:End
:For(X,0,79,79
:For(A,0,15
:Line(A+X,0,A+X,62,0
:End
:End
:DelVar VDelVar [J]DelVar ADelVar B
:{3,3->dim([J]
:1->J
:Lbl 99
:Repeat [J](1,1) and [J](1,2) and [J](1,3) and [J](2,1) and [J](2,2) and [J](2,3) and [J](3,1) and [J](3,2) and [J](3,3)
:DelVar T
:For(A,0,79,79
:For(X,0,15
:Line(A+X,0,A+X,62,0
:End
:End
:Text(31,0,Str1
:Text(31,80,Str2
:If J=1
:78->X
:If J=2
:0->X
:For(Y,0,94,2
:Line(X,Y,X+16,Y-16
:End
:If J=1 or Str2=/="IA":Then
:While T=0
:getKey->T
:End
:End
:If T=72 and [J](1,1)=0:Then
:J->[J](1,1
:20->X
:58->Y
:End
:If T=73 and [J](1,2)=0:Then
:J->[J](1,2
:40->X
:58->Y
:End
:If T=74 and [J](1,3)=0:Then
:J->[J](1,3
:60->X
:58->Y
:End
:If T=82 and [J](2,1)=0:Then
:J->[J](2,1
:20->X
:38->Y
:End
:If T=83 and [J](2,2)=0:Then
:J->[J](2,2
:40->X
:38->Y
:End
:If T=84 and [J](2,3)=0:Then
:J->[J](2,3
:60->X
:38->Y
:End
:If T=92 and [J](3,1)=0:Then
:J->[J](3,1
:20->X
:18->Y
:End
:If T=93 and [J](3,2)=0:Then
:J->[J](3,2
:40->X
:18->Y
:End
:If T=94 and [J](3,3)=0:Then
:J->[J](3,3
:60->X
:18->Y
:End
:If J=1
:999->K
:If J=2
:888->K
:prgm@MORP
:If (J=[J](1,1) and J=[J](1,2) and J=[J](1,3)) or (J=[J](2,1) and J=[J](2,2) and J=[J](2,3)) or (J=[J](3,1) and J=[J](3,2) and J=[J](3,3)) or (J=[J](1,1) and J=[J](2,1) and J=[J](3,1)) or (J=[J](1,2) and J=[J](2,2) and J=[J](3,2)) or (J=[J](1,3) and J=[J](2,3) and J=[J](3,3)) or (J=[J](1,1) and J=[J](2,2) and J=[J](3,3)) or (J=[J](3,1) and J=[J](2,2) and J=[J](1,3)
:Goto V
:If [J](1,1) and [J](1,2) and [J](1,3) and [J](2,1) and [J](2,2) and [J](2,3) and [J](3,3) and [J](3,1) and [J](3,2):Then
:Disp "EGALITE"
:Pause
:Goto 0
:End
:If J=1:Then
:2->J
:Else
:If Str2=/="IA
:1->J
:End
:If J=2:Then
:If Str2="IA" and H:Then
:888->K
:randInt(1,9)->R
:If H=2:Then
:1->A
:2->B
:If [J](1,3)=0 and ((A=[J](1,1) and A=[J](1,2)) or (A=[J](2,2) and A=[J](3,1)) or (A=[J](2,3) and A=[J](3,3)) or (B=[J](1,1) and A=[J](1,2)) or (B=[J](2,2) and B=[J](3,1)) or (B=[J](2,3) and B=[J](3,3
:3->R
:If [J](1,1)=0 and ((A=[J](1,2) and A=[J](1,3)) or (A=[J](2,1) and A=[J](3,1)) or (A=[J](2,2) and A=[J](3,3)) or (B=[J](1,2) and B=[J](1,3)) or (B=[J](2,1) and B=[J](3,1)) or (B=[J](2,2) and B=[J](3,3
:1->R
:If [J](1,2)=0 and ((A=[J](1,1) and A=[J](1,3)) or (A=[J](2,2) and A=[J](3,2)) or (B=[J](1,1) and B=[J](1,3)) or (B=[J](2,2) and B=[J](3,2))
:2->R
:If [J](2,1)=0 and ((A=[J](1,1) and A=[J](3,1)) or (A=[J](2,2) and A=[J](2,3)) or (B=[J](1,1) and B=[J](3,1)) or (B=[J](2,2) and B=[J](2,3))
:4->R
:If [J](2,2)=0 and ((A=[J](1,1) and A=[J](3,3)) or (A=[J](2,1) and A=[J](2,3)) or (A=[J](1,3) and A=[J](3,1)) or (A=[J](1,2) and A=[J](3,2)) or (B=[J](1,1) and B=[J](3,3)) or (B=[J](2,1) and B=[J](2,3)) or (B=[J](1,3) and B=[J](3,1)) or (B=[J](1,2) and B=[J](3,2))
:5->R
:If [J](2,3)=0 and ((A=[J](2,2) and A=[J](2,1)) or (A=[J](1,3) and A=[J](3,3)) or (B=[J](2,2) and B=[J](2,1)) or (B=[J](1,3) and B=[J](3,3))
:6->R
:If [J](3,1)=0 and ((A=[J](1,1) and A=[J](2,1)) or (A=[J](3,2) and A=[J](3,3)) or (A=[J](2,2) and A=[J](1,3)) or (B=[J](1,1) and B=[J](2,1)) or (B=[J](3,2) and B=[J](3,3)) or (B=[J](2,2) and B=[J](1,3))
:7->R
:If [J](3,2)=0 and ((A=[J](3,1) and A=[J](3,3)) or (A=[J](1,2) and A=[J](2,2)) or (B=[J](3,1) and B=[J](3,3)) or (B=[J](1,2) and B=[J](2,2))
:8->R
:If [J](3,3)=0 and ((A=[J](1,1) and A=[J](2,2)) or (A=[J](1,3) and A=[J](2,3)) or (A=[J](3,1) and A=[J](3,2)) or (B=[J](1,1) and B=[J](2,2)) or (B=[J](1,3) and B=[J](2,3)) or (B=[J](3,1) and B=[J](3,2)
:9->R
:End
:If R=1:Then
:If [J](1,1):Goto 99
:2->[J](1,1)
:20->X
:58->Y
:End
:If R=2:Then
:If [J](1,2):Goto 99
:2->[J](1,2)
:40->X
:58->Y
:End
:If R=3:Then
:If [J](1,3):Goto 99
:2->[J](1,3)
:60->X
:58->Y
:End
:If R=4:Then
:If [J](2,1):Goto 99
:2->[J](2,1)
:20->X
:38->Y
:End
:If R=5:Then
:If [J](2,2):Goto 99
:2->[J](2,2)
:40->X
:38->Y
:End
:If R=6:Then
:If [J](2,3):Goto 99
:2->[J](2,3)
:60->X
:38->Y
:End
:If R=7:Then
:If [J](3,1):Goto 99
:2->[J](3,1)
:20->X
:18->Y
:End
:If R=8:Then
:If [J](3,2):Goto 99
:2->[J](3,2)
:40->X
:18->Y
:End
:If R=9:Then
:If [J](3,3):Goto 99
:2->[J](3,3)
:60->X
:18->Y
:End
:prgm@MORP
:If (J=[J](1,1) and J=[J](1,2) and J=[J](1,3)) or (J=[J](2,1) and J=[J](2,2) and J=[J](2,3)) or (J=[J](3,1) and J=[J](3,2) and J=[J](3,3)) or (J=[J](1,1) and J=[J](2,1) and J=[J](3,1)) or (J=[J](1,2) and J=[J](2,2) and J=[J](3,2)) or (J=[J](1,1) and J=[J](2,2) and J=[J](3,3)) or (J=[J](3,1) and J=[J](2,2) and J=[J](1,3)) or (J=[J](1,3) and J=[J](2,3) and J=[J](3,3
:Goto V
:1->J
:End
:End
:End
:End
:End
:End
:End
:Disp "EGALITE"
:Pause [
:DelVar KDelVar [J]ClrDraw
:Goto 0
:Lbl V
:DelVar KDelVar [J]
:If J=1
:Disp Str1
:If J=2
:Disp Str2
:Disp "A GAGNE
:Pause
:ClrDraw
:Goto 0
:Lbl D
:DelVar Str1DelVar Str2DelVar [J]DelVar K
:ClrDraw
:ClrHome
:Output(8,5,"prgm14*785ln(
:Output(1,3,"THANKS FOR
:Output(2,5,"PLAYING
:Output(7,9,"CYTROPUS
Programme @MORP
338 octets
- Code:
:If K=999
:Then
: Line(X+1,Y,X+14,Y-13
: Line(X,Y,X+14,Y-14
: Line(X,Y-1,X+13,Y-14
: Line(X+14,Y,X,Y-14
: Line(X+13,Y,X,Y-13
: Line(X+14,Y-1,X+1,Y-14
:End
:If K=888
:Then
: Line(X+7,Y,X,Y-7
: Line(X+7,Y,X+14,Y-7
: Line(X+14,Y-7,X+7,Y-14
: Line(X+7,Y-14,X,Y-7
: Line(X+1,Y-7,X+7,Y-1
: Line(X+2,Y-7,X+7,Y-2
: Line(X+7,Y-1,X+13,Y-7
: Line(X+7,Y-2,X+12,Y-7
: Line(X+13,Y-7,X+7,Y-13
: Line(X+12,Y-7,X+7,Y-12
: Line(X+7,Y-13,X+1,Y-7
: Line(X+7,Y-12,X+2,Y-7
:End
voilà, avec un screenshot si possible!