flèches : déplacement; entrer : sélectionner/déselectionner un pion à jouer; 2,4,6 et 8:direction du saut; anuler : menu quitter (meu de choix)
Code
Programme SOLITAIR
0 -> Xmin
94 -> Xmax
-62 -> Ymin
0 -> Ymax
For(A,-4,-59,-6
If A[inférieur ou égal]-43 or A[supérieur ou égal]-16
Then
Line(38,A,55,A
Else
Line(20,A,73,A
End
End
For(A,20,74,6
If A[inférieur ou égal]35 or A[supérieur ou égal]60
Then
Line(A,-22,A,-40
Else
Line(A,-4,A,-58
End
End
[[9,9,9,1,1,1,9,9,9][9,9,9,1,1,1,9,9,9][9,9,9,1,1,1,9,9,9][1,1,1,1,1,1,1,1,1][1,1,1,1,0,1,1,1,1][1,1,1,1,1,1,1,1,1][9,9,9,1,1,1,9,9,9][9,9,9,1,1,1,9,9,9][9,9,9,1,1,1,9,9,9 -> [A]
For(A,1,9
For(B,1,9
If 1=[A](A,B
Pt-On(17+6B,-1-6A,2
End
End
{5,5 -> L1
While 1
Repeat K
getKey -> K
End
If K=45
Goto 1
If K=105 and 1=[A](L1(1),L1(2
Then
Pt-Off(17+6L1(2),-1-6L1(1),3
Repeat sum(K={73,82,84,93,105
getKey -> K
End
1 -> I
Send(9prgmZSOLITAI //"Envoi(9" en français) dans "prgm"/"entré/sortie"
If I and [A](L1(1),L1(2
Pt-On(17+6L1(2),-1-6L1(1),3
If I and not([A](L1(1),L1(2
Pt-On(17+6L1(2),-1-6L1(1
End
Pt-Off(17+6L1(2),-1-6L1(1
L1(1)+(K=34)-(K=25 -> L1(1
L1(2)-(K=24)+(K=26 -> L1(2
Pt-On(17+6L1(2),-1-6L1(1
End
Lbl 1
Menu("INTERRUPTION","QUITTER",2,"RECOMANCER",3,"PAUSE",4,"REPRENDRE",5
Lbl 4
prgmOFF
Lbl 5
DispGraph
End
Lbl 2
ClrHome
"
Code
ProgrammeZSOLITAI
If K=73 and 2<L1(1
Then
If [A](L1(1)-1,L1(2))=1 and not([A](L1(1)-2,L1(2
Then
1 -> [A](L1(1)-2,L1(2
0 -> [A](L1(1)-1,L1(2
0 -> [A](L1(1),L1(2
DelVar IPt-Off(17+6L(2),-1-6L1(1),2
Pt-Off(17+6L1(2),5-6L1(1),2
Pt-Off(17+6L1(2),5-6L1(1),1
Pt-On(17+6L1(2),11-6L1(1),2
End
End
If K=82 and 2<L1(2
Then
If [A](L1(1),L1(2)-1)=1 and not([A](L1(1),L1(2)-2
Then
1 -> [A](L1(1),L1(2)-2
0 -> [A](L1(1),L1(2)-1
0 -> [A](L1(1),L1(2
DelVar IPt-Off(17+6L1(2),-1-6L1(1),2
Pt-Off(11+6L1(2),-1-6L1(1),2
Pt-Off(11+6L1(2),-1-6L1(1),1
Pt-On(5+6L1(2),-1-6L1(1),2
End
End
If K=84 and -2<L1(2
Then
If [A](L1(1),L1(2)+1)=1 and not([A](L1(1),2+L1(2
Then
1 -> [A](L1(1),2+L1(2
0 -> [A](L1(1),1+L1(2
0 -> [A](L1(1),L1(2
DelVar IPt-Off(17+6L1(2),-1-6L1(1),2
Pt-Off(23+6L1(2),-1-6L1(1),2
Pt-Off(23+6L1(2),-1-6L1(1),1
Pt-On(29+6L1(2),-1-6L1(1),2
End
End
If K=93 and -2<L1(1
Then
If [A](L1(1)+1,L1(2))=1 and not([A](L1(1)+2,L1(2
Then
1 -> [A](L1(1)+2,L1(2
0 -> [A](L1(1)+1,L1(2
0 -> [A](L1(1),L1(2
DelVar IPt-Off(17+6L1(2),-1-6L1(1),2
Pt-Off(17+6L1(2),-7-6L1(1),2
Pt-Off(17+6L1(2),-7-6L1(1),1
Pt-On(17+6L1(2),-13-6L1(1),2
End