Ah, sinon j'en ai un aussi, j'ai participé à un concours avec (qui n'a tjrs pas donné de résultats)... =P
J'aurais pu l'optimiser plus en taille (il fait 1490 octets); mais c'est un morpion spécial: il a une taille de tableau variable et une taille de victoire variable aussi...
[nosmile]
:ClrHome
:Full
:StoreGDB 1
:FnOff
:Func
:AxesOff
:GridOff
:0→Ymin
:0→Xmin
:62→Ymax
:94→Xmax
:ClrDraw
:
:Repeat A≤10 and A
: Input "Hauteur(1-10):",A
: abs(int(A→A
:End
:Repeat B≤15 and B
: Input "Largeur(1-15):",B
: abs(int(B→B
:End
:Repeat L>0 and L≤max(A,B
: Input "Longueur:",L
: abs(int(L→L
:End
:
:min(int(62/A),int(94/B→C
:
:
:BC→D
:AC→E
:iPart(47-.5D→F
:iPart(31-.5E→G
:
:F+D
:For(X,G,G+E,C
: Line(F,X,Ans,X
:End
:
:G+E
:For(X,F,F+D,C
: Line(X,G,X,Ans
:End
:
:If fPart(.5E
: G+1→G
:
:0→X
:0→Y
:
:G+YC→I
:F+XC→J
:
:Pxl-On(I+1,J+1
:Pxl-On(I+1,J+C-1
:Pxl-On(I+C-1,J+C-1
:Pxl-On(I+C-1,J+1
:{A,B→dim([A]
:Fill(2,[A]
:0→W
:0→Θ
:0→Z
:Repeat Z or W≥AB
: Repeat max(Ans={21,24,25,26,34,45,105
: getKey→K
: End
: If Ans=45
: Then
: ClrDraw
: ClrHome
: RecallGDB 1
: DelVar GDB1DelVar [A]
: Stop
: End
: If Ans≠105 and Ans≠21
: Then
: Pxl-Off(I+1,J+1
: Pxl-Off(I+1,J+C-1
: Pxl-Off(I+C-1,J+C-1
: Pxl-Off(I+C-1,J+1
:
: X+(Ans=26)(X+1<B)-(Ans=24)(X>0→X
: Y+(K=34)(Y+1<A)-(K=25)(Y>0→Y
: G+YC→I
: F+XC→J
:
: Pxl-On(I+1,J+1
: Pxl-On(I+1,J+C-1
: Pxl-On(I+C-1,J+C-1
: Pxl-On(I+C-1,J+1
: Else
: X+1→X
: Y+1→Y
: If 2=[A](Ans,X
: Then
: Θ→[A](Ans,X
:
: If Ans
: Then
: Circle(J+.5C,62-(I+.5C),‾1.5+.5(C-1
: Else
: Line(J,62-I,J+C,62-I-C
: Line(J,62-I-C,J+C,62-I
: End
:
: 1→S
: 1→V
: 1→T
: While X+Ans≤B and V
: Θ=[A](Y,X+Ans→V
: S+Ans→S
: T+1→T
: End
: S→U
:
: 1→V
: 1→T
: While X-Ans≥1 and V
: Θ=[A](Y,X-Ans→V
: S+Ans→S
: T+1→T
: End
:
: If S≥L
: Then
: 1→Z
: Line(F+C(X-1+U),62-(G+CY-.5C),F+C(X-1+U-S),62-(G+CY-.5C
: End
:
: 1→S
: 1→V
: 1→T
: While Y+Ans≤A and V
: Θ=[A](Y+Ans,X→V
: S+Ans→S
: T+1→T
: End
: S→U
:
: 1→V
: 1→T
: While Y-Ans≥1 and V
: Θ=[A](Y-Ans,X→V
: S+Ans→S
: T+1→T
: End
:
: If S≥L
: Then
: 1→Z
: Line(F+CX-.5C,62-(G+C(Y-1+U)),F+CX-.5C,62-(G+C(Y-1+U-S
: End
:
: 1→S
: 1→V
: 1→T
: While X+Ans≤B and Y+Ans≤A and V
: Θ=[A](Y+Ans,X+Ans→V
: S+Ans→S
: T+1→T
: End
: S→U
:
: 1→V
: 1→T
: While X-Ans≥1 and Y-Ans≥1 and V
: Θ=[A](Y-Ans,X-Ans→V
: S+Ans→S
: T+1→T
: End
:
: If S≥L
: Then
: 1→Z
: Line(F+C(X-1+U),62-(G+C(Y-1+U)),F+C(X-1+U-S),62-(G+C(Y-1+U-S
: End
:
:
: 1→S
: 1→V
: 1→T
: While X+Ans≤B and Y-Ans≥1 and V
: Θ=[A](Y-Ans,X+Ans→V
: S+Ans→S
: T+1→T
: End
: S→U
:
: 1→V
: 1→T
: While X-Ans≥1 and Y+Ans≤A and V
: Θ=[A](Y+Ans,X-Ans→V
: S+Ans→S
: T+1→T
: End
:
: If S≥L
: Then
: 1→Z
: Line(F+C(X-1+U),62-(G+C(Y-U)),F+C(X-1+U-S),62-(G+C(Y-U+S
: End
:
: 1-Θ→Θ
: 1+W→W
: getKey
: End
: X-1→X
: Y-1→Y
: End
:End
:RecallGDB 1
:DelVar GDB1DelVar [A]
:Repeat Ans
: getKey
:End
:
:ClrHome
:ClrDraw