ClrDraw
ClrHome
For(A,23,73,10
Line(A,7,A,57
End
For(A,7,57,10
Line(23,A,73,A
End
For(B,7,57,10
For(A,23,73,10
Pt-On(A-1,B
Pt-On(A+1,B
Pt-On(A,B-1
Pt-On(A,B+1
Pt-On(A-1,B-1
Pt-On(A-1,B+1
Pt-On(A+1,B-1
Pt-On(A+1,B+1
Pt-Off(A,B
End
End
ClrList L1,L3
36->dim(L3
25->dim(L1
For(A,1,36
int(rand4->B
If B=3:1->L3(A
If B=1:0->L3(A
If B=2:1->L3(A
End
0->B
For(A,1,29
If A=6 or A=12 or A=18 or A=24:A+1->A
B+1->B
L3(A)+L3(A+1)+L3(A+6)+L3(A+7)->L1(B
End
36->dim(L5
L3->L5
ClrList L3
0->A
For(B,8,48,10
For(C,28,68,10
A+1->A
Text(B,C,L1(A
End
End
36->dim(L3
1->A
57->[THETA]
23->Z
10->T
Lbl A
Line(Z,61,Z,60
Line(19,[THETA],20,[THETA]
Line(Z,3,Z,4
Line(76,[THETA],77,[THETA]
Pt-Off(Z-T,61
Pt-Off(Z-T,60
Pt-Off(Z+T,61
Pt-Off(Z+T,60
Pt-Off(19,[THETA]-T
Pt-Off(20,[THETA]-T
Pt-Off(19,[THETA]+T
Pt-Off(20,[THETA]+T
Pt-Off(Z-T,3
Pt-Off(Z-T,4
Pt-Off(Z+T,3
Pt-Off(Z+T,4
Pt-Off(77,[THETA]-T
Pt-Off(76,[THETA]-T
Pt-Off(77,[THETA]+T
Pt-Off(76,[THETA]+T
getKey->K
If K=24 and Z[DIFFERENT DE]23:A-1->A
If K=24 and Z[DIFFERENT DE]23:Z-T->Z
If K=26 and Z[DIFFERENT DE]73:A+1->A
If K=26 and Z[DIFFERENT DE]73:Z+T->Z
If K=25 and A-6>0:A-6->A
If K=25 and [THETA][DIFFERENT DE]57:[THETA]+T->[THETA]
If K=34 and A+6÷36:A+6->A
If K=34 and [THETA][DIFFERENT DE]7:[THETA]-T->[THETA]
If K=105:Pt-Change(Z,[THETA]
If pxl-Test(62-[THETA],Z)=1:1->L3(A
If pxl-Test(62-[THETA],Z)=0:0->L3(A
If K=21:Goto C
If K=45:Goto B
0->B
Goto A
Lbl B
StorePic 3
ClrDraw
Goto 0
Lbl C
StorePic 3
For(G,1,36
If L3(G)[DIFFERENT DE]L5(G):Goto D
If G=36:Goto E
End
Goto E
Lbl D
ClrDraw
Text(25,18,"TON JEU CONTIENT
Text(37,26,"DES ERREURS.
Pause
ClrDraw
RecallPic 3
Goto A
Lbl E
ClrDraw
Text(29,13,"TA GRILLE EST JUSTE.
Pause
ClrDraw
Output(1,1,"
Stop
Autorisation : Membre
Nb de messages : 591
Inscrit le : Mer 04 Avr 2007, 13:29
Posté le : Dim 22 Avr 2007, 17:47
En fait il s'agit d'une sorte de démineur.
Le jeu mache très bien sauf qu'il y a une erreur de label quand on appuie sur CLEAR. D'ailleurs à quoi sert d'appuyer sur cette touche ?
---------------------- Vive la programmation et vive le vibraphone !!!
Autorisation : Membre
Nb de messages : 3293
Inscrit le : Sam 31 Déc 2005, 19:48
Posté le : Mar 24 Avr 2007, 12:58
Voici une version améliorée de celui de Sangohan38, avec une grille de 7x5.
Il y a une erreur de label lorsqu'on appuie sur CLEAR , mais c'est normal.
Vibra
Code
0->Xmin
94->Xmax
0->Ymin
62->Ymax
AxesOff
GridOff
FnOff
ClrDraw
ClrHome
For(A,13,83,10
Line(A,7,A,57
End
For(A,7,57,10
Line(13,A,83,A
End
For(B,7,57,10
For(A,13,83,10
Pt-On(A-1,B
Pt-On(A+1,B
Pt-On(A,B-1
Pt-On(A,B+1
Pt-On(A-1,B-1
Pt-On(A-1,B+1
Pt-On(A+1,B-1
Pt-On(A+1,B+1
Pt-Off(A,B
End
End
ClrList L4,L5
36->dim(L5
25->dim(L4
For(A,1,48
int(rand1,99->L5(A)
End
0->B
For(A,1,39
If A=8 or A=16 or A=24 or A=32:A+1->A
B+1->B
L5(A)+L5(A+1)+L5(A+8)+L5(A+9)->L4(B
End
0->A
For(B,7,47,10
For(C,17,77,10
A+1->A
Text(B,C,L4(A
End
End
ClearList L4
48->dim(L4
1->A
57->[THETA]
13->Z
10->T
Lbl A
Line(Z,61,Z,60
Line(9,[THETA],10,[THETA]
Line(Z,3,Z,4
Line(86,[THETA],87,[THETA]
Line(Z-T,61,Z-T,60,0
Line(Z+T,61,Z+T,60,0
Line(9,[THETA]-T, 10,[THETA]-T,0
Line(9,[THETA]+T, 10,[THETA]+T
Line(Z-T,3, Z-T,4,0
Line(Z+T,3,Z+T,4,0
Line(87,[THETA]-T, 86,[THETA]-T,0
Line(87,[THETA]+T, 86,[THETA]+T,0
getKey->K
If K=24 and Z[DIFFERENT DE]13
Then
A-1->A
Z-T->Z
End
If K=26 and Z[DIFFERENT DE]83
Then
A+1->A
Z+T->Z
End
If K=25 and [THETA][DIFFERENT DE]57
Then
A-8->A
End
[THETA]+T->[THETA]
If K=34 and [THETA][DIFFERENT DE]7
Then
A+8->A
[THETA]-T->[THETA]
End
If K=105:Pt-Change(Z,[THETA]
If pxl-Test(62-[THETA],Z)=1:1->L4(A
If pxl-Test(62-[THETA],Z)=0:0->L4(A
If K=21:Goto C
If K=45:Goto B
0->B
Goto A
Lbl B
StorePic 3
ClrDraw
Goto 0
Lbl C
StorePic 3
For(G,1,48
If L3(G)[DIFFERENT DE]L5(G):Goto D
If G=48:Goto E
End
Goto E
Lbl D
ClrDraw
Text(25,18,"TON JEU CONTIENT
Text(37,26,"DES ERREURS.
Pause
ClrDraw
RecallPic 3
Goto A
Lbl E
ClrDraw
Text(29,13,"TA GRILLE EST JUSTE.
Pause
ClrDraw
Output(1,1,"
Stop
Autorisation : Membre
Nb de messages : 3293
Inscrit le : Sam 31 Déc 2005, 19:48
Posté le : Mer 25 Avr 2007, 13:50
Je sais que c'est ton prog.
Mais je l'ai mis ici car en réalité, tu n'as que modifié légèrement mon prog.
De plus, j'ai mis ta signature en espèrant que les gens comprendrons.
Je vais donc la modifiée.
Autorisation : Membre
Nb de messages : 591
Inscrit le : Mer 04 Avr 2007, 13:29
Posté le : Ven 27 Avr 2007, 14:05
En fait moi j'ai aucun problème avec la correction. C'est la touche [CLEAR] (je ne sais pas à quoi elle sert, et toi seul peut me le dire), qui me met une erreur de label.
---------------------- Vive la programmation et vive le vibraphone !!!
Autorisation : Membre
Nb de messages : 3293
Inscrit le : Sam 31 Déc 2005, 19:48
Posté le : Ven 27 Avr 2007, 21:12
La touche CLEAR est sensée servir pouer éteindre précipitamment le prog qund le prof arrive.
Mais j'ai pas fait le label qui va avec.
De plus, la méthode vérification propose une solution alors que plusieurs sont possibles.
Autorisation : Membre
Nb de messages : 3293
Inscrit le : Sam 31 Déc 2005, 19:48
Posté le : Dim 13 Mai 2007, 11:05
Un peu de retard mais voila le code corrigé:
Code
ClrDraw
ClrHome
For(A,23,73,10
Line(A,7,A,57
End
For(A,7,57,10
Line(23,A,73,A
End
For(B,7,57,10
For(A,23,73,10
Pt-On(A-1,B
Pt-On(A+1,B
Pt-On(A,B-1
Pt-On(A,B+1
Pt-On(A-1,B-1
Pt-On(A-1,B+1
Pt-On(A+1,B-1
Pt-On(A+1,B+1
Pt-Off(A,B
End
End
ClrList L,Lf
36üdim(Lf
25üdim(L
For(A,1,36
int(rand4üB
If B=3:1üLf(A
If B=1:0üLf(A
If B=2:1üLf(A
End
0üB
For(A,1,29
If A=6 or A=12 or A=18 or A=24:A+1üA
B+1üB
Lf(A)+Lf(A+1)+Lf(A+6)+Lf(A+7)üL(B
End
ClrList Lf
0üA
For(B,8,48,10
For(C,28,68,10
A+1üA
Text(B,C,L(A
End
End
1üA
57üÁ
23üZ
10üT
36üdim(Lf
Lbl A
Line(Z,61,Z,60
Line(19,Á,20,Á
Line(Z,3,Z,4
Line(76,Á,77,Á
Pt-Off(Z-T,61
Pt-Off(Z-T,60
Pt-Off(Z+T,61
Pt-Off(Z+T,60
Pt-Off(19,Á-T
Pt-Off(20,Á-T
Pt-Off(19,Á+T
Pt-Off(20,Á+T
Pt-Off(Z-T,3
Pt-Off(Z-T,4
Pt-Off(Z+T,3
Pt-Off(Z+T,4
Pt-Off(77,Á-T
Pt-Off(76,Á-T
Pt-Off(77,Á+T
Pt-Off(76,Á+T
getKeyüK
If K=24 and Zø23:A-1üA
If K=24 and Zø23:Z-TüZ
If K=26 and Zø73:A+1üA
If K=26 and Zø73:Z+TüZ
If K=25 and A-6>0:A-6üA
If K=25 and Áø57:Á+TüÁ
If K=34 and A+6÷36:A+6üA
If K=34 and Áø7:Á-TüÁ
If K=105:Pt-Change(Z,Á
If pxl-Test(63-Á,Z-1)=1:1üLf(A
If pxl-Test(63-Á,Z-1)=0:0üLf(A
If K=21:Goto C
If K=45:Goto B
0üB
Goto A
Lbl B
StorePic 3
ClrDraw
Goto 0
Lbl C
0üH
StorePic 3
For(G,1,25
If G=6 or G=11 or G=16 or G=21:H+1üH
H+1üH
If Lf(H)+Lf(H+1)+Lf(H+6)+Lf(H+7)øL(G):Goto D
End
Goto E
Lbl D
ClrDraw
Text(25,18,"TON JEU CONTIENT
Text(37,26,"DES ERREURS.
Pause
ClrDraw
RecallPic 3
Goto A
Lbl E
ClrDraw
Text(29,13,"TA GRILLE EST JUSTE.
Pause
Lbl B
ClrHome
ClrDraw
Output(1,1,"
Stop