Forum

Catégorie : Programmes
Forum : Les programmes des internautes
Vues : 6315
Réponses : 27
Type : discussion
Etat : réponses autorisées

Squaro

Sangohan38 le 21/04/2007 à 13:32
J'ai découvert il n'y as pas longtemps un jeux nommé Squaro.
Ce jeux est simple à programmer.
Voici les rêgles du squaro:http://www.squaro.fr/regles.ph[...]090190bd6afdcc7

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 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



Sangohan38

PS: Je compte améliorer l'interface.
PMdej le 21/04/2007 à 15:14
personellement je trouve que ça a l'air pas mal !!!!!
godgrace.gif
PMdej le 21/04/2007 à 16:27
Je l'ai recopié et il marche pas !!!!!!!! frozen.gif frozen.gif cupsmiley.gif ahh.gif ahh.gif cry.gif

godgrace.gif
Sangohan38 le 21/04/2007 à 19:22
A oui, j'ai oublier de préciser qu'il faut faire:

Code
0->Xmin
94->Xmax
0->Ymin
62->Ymax
AxesOff
GridOff


Sangohan38
PMdej le 21/04/2007 à 22:12
ok je vais essayer je te donne la réponse dans 5 mn
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
godgrace.gif
PMdej le 21/04/2007 à 22:15
ca met un quart d'heure avant de finir !!!!
je sais meme pas si ca se finit !!!!!!
godgrace.gif
PMdej le 21/04/2007 à 22:18
bon il marche toujours pas !!!!!!!!
godgrace.gif
donc ça marche pas !!!!!
godgrace.gif
Sangohan38 le 22/04/2007 à 11:06
J'y ai jouer pendant pas mal de temps cette semaine donc je peut t'assurer que ça marche.
En quoi ça marche pas pour toi?

Sangohan38

PS: Tu peut éditer tes messages sinon, je vais être obligé de les supprimer/éditer à ta place.
vibra le 22/04/2007 à 17:47
En fait il s'agit d'une sorte de démineur. cupsmiley.gif
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 ?
Sangohan38 le 22/04/2007 à 18:24
Euh je sais plus.
Mais la c'est le jeux pas l'interface qui va avec et que je vais faire cette semaine.

Sangohan38
Stupid le 22/04/2007 à 21:27
c'est prenant comme jeu !!!
PMdej le 23/04/2007 à 21:48
la bare tout a droite ne s'affiche pas !!!!!!!
godgrace.gif
vibra le 24/04/2007 à 09:17
Tu l'as mal tapé, moi il marche très bien.
Sangohan38 le 24/04/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
 
vibra le 24/04/2007 à 16:28
Et mais c'est mon programme ça !! crazy.gif crazy.gif crazy.gif crazy.gif crazy.gif frozen.gif
Sangohan38 le 25/04/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.

Sangohan38
vibra le 25/04/2007 à 16:00
Ok, désolé, j'avais pas vu.
PMdej le 25/04/2007 à 21:53
mais comment on fait pour faire vérifier la grille (du premier code)
???
godgrace.gif
vibra le 26/04/2007 à 11:51
Pour faire vérifier la grille, t'appuies sur [2nd].
PMdej le 26/04/2007 à 21:35
ok merci beaucoup je vais essayer !!!!!
godgrace.gif
Sangohan38 le 27/04/2007 à 12:48
Enfait mon code à un petit problème: il faut que la grille soit égale à celle générée.

Je sais comment modifier donc, je le ferait ce week-end.

Sangohan38
vibra le 27/04/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.
Sangohan38 le 27/04/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.

Sangohan38
PMdej le 27/04/2007 à 21:26
laugh.gif le prie c'est que c'est vrai !!!!!!! pour la touche clear de la caldos et le prof de maths !!!!! lol laugh.gif
godgrace.gif
Sangohan38 le 13/05/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


Sangohan38
mad67 le 15/05/2007 à 10:48
Moi avec mes jeux, je fait un lbl du style:

Code
getkey->K
if K=105
goto 1


Et plus tard dans le prog:

Code
lbl 1
ClrHome
pause


Sa aussi sa fait que le prof voit rien!
Sangohan38 le 15/05/2007 à 11:24
C'est ce que j'ai mis dans mon prog: quand on appuye sur Clear, on va au label de la fin qui efface.

Sangohan38
mad67 le 16/05/2007 à 07:15
C'est vrai que je te copie pour le style de programmation ya pas a s'étonner