Autorisation : Membre
Nb de messages : 19
Inscrit le : Sam 31 Mai 2008, 15:10
Post le : Mer 04 Jui 2008, 18:18
bonjour
je poste ici tout mes programmes (je ne pouvais pas le faire plus tt car mon cble ti-PC vient juste d'arriver).
mes programmes ne sont pas trs dvelopp et tout les jeux que j'ai fait existent dj (et souvent en mieux )mais je voulais les poster ici pour avoir votre avis et les amliorer.
la notation est celle de TI-GRAPH LINk
donc les -> sont des
...
tout d'abord un jeu de pendu (pour le graphisme du "pendu" je me suis inspir d'un programme de ce forum mais pas pour le code c'est pour cela que je le poste)
Code
" "Str1
Str1Str2
Str2Str3
11dim(L
0L
0A
0B
0C
0X
Lbl 1
ClrHome
Input "MOT A CHERCHER : ",Str1
length(Str1X
If X>11
Then
Pause "MOT TROP LONG"
Goto 1
End
Str1+"-"Str1
Fill(X+1,L
ClrHome
For(G,1,X
Output(5,G,"-
End
Lbl 2
Output(1,1,"PLUS QUE COUPS
Output(1,10,9-C
Disp ""
Input " ",Str2
Lbl 9
0L
ClrHome
For(M,1,X
Output(5,M,sub(Str1,L(M),1
End
If C1
Output(8,11,"----
If C2
Then
For(U,4,7
Output(U,12,"!
End
End
If C4
Output(4,13,"/
If C3
Output(3,11,"-----
If C5
Output(4,15,"!
If C6
Output(5,15,"*
If C7
Output(6,15,"O
If C8
Output(6,14,"-
If C8
Output(6,16,"-
If C9
Output(7,15,"
If C9 or B=X
Goto 5
Output(1,1,"PLUS QUE COUPS
Output(1,10,9-C
Disp ""
Input " ",Str2
length(Str2Y
If Y1
Goto 9
inString(Str3,Str2)U
If U0
Goto 9
Str2+Str3Str3
Lbl 3
inString(Str1,Str2,A+1)A
If A=0 and L=0
Then
C+1C
Goto 9
End
If A0 and L=0
Then
B+1B
1L
AL(A)
Goto 3
End
If A0 and L=1
Then
B+1B
AL(A)
Goto 3
End
If A=0 and L=1
Goto 9
Goto 9
Lbl 5
If C9
Output(2,1,"PERDU"
Output(3,1,"LE MOT
Output(4,1,"ETAIT
If BX
Output(2,1,"GAGNE!"
Output(5,1,sub(Str1,1,X
Pause
ClrHome
Output(8,2,"CREATED BY SEB
Stop
End
maintenant un jeu qui simule le lanc de ds (entre 1 et 5 ds)
Code
FnOff
AxesOff
100Xscl
100Yscl
0Xmin
9.4Xmax 6.2Ymin
0Ymax
Lbl Z
0K
ClrDraw
ClrHome
Output(8,2,"CREATED BY SEB
Input "NOMBRE DE DES ",W
int(W)W
If W>5 or W<1
Then
Output(4,5,"ERREUR
Output(6,1,"ENTREZ UN NOMBRE ENTRE 1 ET 5
Pause
Goto Z
End
If W=1
0C
If W=2
2C
If W=3
Then
4C
1K
End
If W=4
6C
If W=5
8C
Goto Q
Lbl K
Lbl Q
For(B,0,C,2)
Line(B,3,B,2
Line(B,2,1+B,2
Line(1+B,2,1+B,3
Line(1+B,3,1.3+B,2.7
Line(B,3,1+B,3
Line(1.3+B,2.7,1.3+B,1.7
Line(1.3+B,1.7,0.3+B,1.7
Line(B,2,0.3+B,1.7
Line(1+B,2,1.3+B,1.7
End
For(B,0,C,2)
randInt(1,6A
If A=1
Pxl-On(25,5+B*10)
If A=2
Then
Pxl-On(28,2+B*10
Pxl-On(22,8+B*10
End
If A=3
Then
Pxl-On(28,2+B*10
Pxl-On(22,8+B*10
End
If A=4
Then
Pxl-On(22,2+B*10
Pxl-On(22,8+B*10
Pxl-On(28,2+B*10
Pxl-On(28,8+B*10
End
If A=5
Then
Pxl-On(22,2+B*10
Pxl-On(28,2+B*10
Pxl-On(22,8+B*10
Pxl-On(28,8+B*10
Pxl-On(25,5+B*10
End
If A=6
Then
Pxl-On(22,2+B*10
Pxl-On(28,2+B*10
Pxl-On(22,8+B*10
Pxl-On(28,8+B*10
Pxl-On(25,2+B*10
Pxl-On(25,8+B*10
End
End
Pause
0K
Goto Z
maintenant un jeu de "course" un peut lent(mon premier programme alors soyez indulgent^^)
Code
9dim(L
If L(9)=9959
Then
Goto I
Else
9dim(L)
Fill(0,L)
End
Lbl I
ClrHome
Output(4,6,"COURSE"
1Y
For(,2,15)
Output(2,,""
Output(3,,""
Output(4,,""
Output(5,,""
Output(6,,""
Output(7,,""
Output(4,6,"COURSE"
End
For(,1,100)
2A
End
Lbl M
ClrHome
8X
0U
0V
0D
0E
0M
0H
0G
0N
0K
0L
0J
0B
0
11C
Menu(" MENU ","JOUER",A,"INSTRUCTIONS",B,"MEILLEURS SCORES",C,"QUITTER",D)
Lbl D
ClrHome
Stop
Lbl A
ClrHome
Menu(" DIFFICULTE ","FACILE",J,"MOYEN",K,"DIFFICILE",L)
Lbl J
7T
T-1S
Goto R
Lbl K
11T
T-1S
13C
Goto R
Lbl L
12T
T-1S
13C
Goto R
Lbl R
ClrHome
Output(2,1,"PTS"
For(W,1,8)
Output(W,S,"I"
Output(W,16,"I"
End
Output(8,C,"8"
Lbl Z
L+1L
Output(1,1,L
If L4:Then
If U8 or U0
randInt(T,15V
U+1U
If U=9:1U
Output(U,V,"O"
If U1:Output(U-1,V," "
End
If N8 or N0
randInt(T,15M
N+1N
If N=9:Output(N-1,M," "
If N=9:1N
If L5:Then
If J8 or J0
randInt(T,15G
J+1J
If J=9:1J
Output(J,G,"O"
If J1:Output(J-1,G," "
End
If L3:Then
If K8 or K0
randInt(T,15H
K+1K
If K=9:1K
Output(K,H,"O"
If K1:Output(K-1,H," "
End
If L7:Then
If D8 or D0
randInt(T,15E
D+1D
If D=9:1D
Output(D,E,"O"
If D1:Output(D-1,E," "
End
If N9 and NJ and NK and ND
Then
If =1:Then
If N=8:Then
0
End
Goto S
End
Output(N,M,""
If N1:Output(N-1,M," "
End
Lbl S
Output(X,C,"8"
0B
getKeyB
If B=45:Then
ClrHome
Stop
End
If B=105:Then
Output(4,4,"[ PAUSE ]"
Pause
Output(4,4," "
Output(4,S,"I"
End
If B=26:Then
If C=15:Goto Z
C+1C
Output(X,C,"8"
Output(X,C-1," ")
End
If B=25:Then
If X=1:Goto Z
X-1X
Output(X,C,"8"
Output(X+1,C," "
End
If B=34:Then
If X=8:Goto Z
X+1X
Output(X,C,"8"
Output(X-1,C," "
End
If B=24:Then
If CT:Goto Z
C-1C
Output(X,C,"8")
Output(X,C+1," ")
End
If C=V and U=X
Goto O
If C=G and J=X
Goto O
If C=E and D=X
Goto O
If C=H and K=X
Goto O
If C=M and N=X and =0
Then
1
L+19L
End
If D=8:Output(8,E," "
If N=8:Then
If CM:Output(8,M," "
End
If J=8:Output(8,G," "
If K=8:Output(8,H," "
If U=8:Output(8,V," "
Goto Z
Lbl O
ClrHome
Output(3,5,"GAME OVER"
Pause
ClrHome
Output(3,3,"VOUS AVEZ"
Output(5,1,L
Output(5,5,"POINTS"
LL(8)
SortD(L) 9959L(9)
Output(8,1,"SEB CORPORATION"
Pause
Goto E
Lbl B
Output(1,1,"A L'AIDE DES 4 FLECHES EVITER LES AUTRES VOITURES (O), TOUT ENALLANT SUR LES ,(ENTRER POUR PAUSE,ANNUL POUR QUITTER)"
Pause
Goto M
Lbl C
Menu("MEILLEURS SCORES","VOIR",E,"MISE A ZERO",F
Lbl E
ClrHome
For(W,2,8
Output(W,2,W-1)
End
Disp "MEILLEURS SCORES"
For(W,2,8
Output(W,12,L(W-1)
End
Pause
Goto M
Lbl F
ClrHome
{0,0,0,0,0,0,0,0,9959}L
Output(4,3,"REMISE A ZERO EFFECTUEE"
Pause
Goto M
un jeu de morpion (un peut lent aussi)
Code
ClrHome
2M
1U
4I
2K
For(,2,15)
Output(4,6,"MORPION
Output(2,,"
Output(3,,"
Output(4,,"
Output(5,,"
Output(6,,"
Output(7,,"
End
Pause
ClrHome
{3,8}dim([A]
Fill(0,[A]
0S
0V
Lbl W
If M=1
Then
1U
2M
Goto J
End
If M=2
Then
2U
1M
Goto J
End
Lbl J
0W
Fill(0,[A]
Output(1,1,"I--I--I--I I I I I I--I--I--I I I I I I--I--I--I I I I I I--I--I--I
Output(1,12,">< ()
Output(2,15,S
Output(2,12,V
4D
5F
4A
5C
Lbl A
If [A](I/2,K)=0
Output(I,K,"
If [A](I/2,K)=1
Output(I,K,"><
If [A](I/2,K)=2
Output(I,K,"()
If U=1:Then:Output(A,C,"><
Output(5,13,"><
End
If U=2:Then:Output(D,F,"()":Output(5,13,"()":End
Goto Z
Lbl Z
If U=2:Goto 2
If U=1:Goto 1
Lbl Q
For(Z,1,3)
If [A](Z,2)*[A](Z,5)*[A](Z,8)=1 or [A](1,5)*[A](2,5)*[A](3,5)=1 or [A](1,8)*[A](2,8)*[A](3,8)=1 or [A](1,2)*[A](2,2)*[A](3,2)=1 or [A](1,2)*[A](2,5)*[A](3,8)=1 or [A](1,8)*[A](2,5)*[A](3,2)=1
Goto V
If [A](Z,2)*[A](Z,5)*[A](Z,8)=8 or [A](1,2)*[A](2,2)*[A](3,2)=8 or [A](1,5)*[A](2,5)*[A](3,5)=8 or [A](1,8)*[A](2,8)*[A](3,8)=8 or [A](1,2)*[A](2,5)*[A](3,8)=8 or [A](1,8)*[A](2,5)*[A](3,2)=8
Goto K
End
If W=9
Goto X
Goto Z
Lbl 2
0Y
getKeyE
If E=24:Then
If F<4:Goto A
F-3F
Output(D,F,"()
F+3K
DI
Goto A
End
If E=26:Then
If F>5:Goto A
F+3F
Output(D,F,"()
F-3K
DI
End
If E=25:Then
If D<3:Goto A
D-2D
Output(D,F,"()
D+2I
FK
End
If E=34:Then
If D=6:Goto A
D+2D
Output(D,F,"()
D-2I
FK
End
If E=105:Then
D/2Q
FP
If [A](Q,P)=0
Then
2[A](Q,P)
1U
4A
5B
W+1W
Goto Q
End:End
Goto A
Lbl 1
0Y
getKeyB
If B=24:Then
If C<4:Goto A
C-3C
Output(A,C,"><
AI
C+3K
Goto A
End
If B=26:Then
If C>5:Goto A
C+3C
Output(A,C,"><
AI
C-3K
Goto A
End
If B=25:Then
If A<3:Goto A
A-2A
Output(A,C,"><
A+2I
CK
End
If B=34:Then
If A=6:Goto A
A+2A
Output(A,C,"><
A-2I
CK
End
If B=105:Then
A/2Y
CX
If [A](Y,X)=0
Then
1[A](Y,X)
2U
4D
5F
W+1W
Goto Q
End:End
Goto A
Lbl V
V+1V
ClrHome
Output(4,4,">< A GAGNE
Output(8,2,"CREATED BY SEB
Pause
Goto W
Lbl K
S+1S
ClrHome
Output(4,4,"() A GAGNE
Output(8,2,"CREATED BY SEB
Pause
Goto W
Lbl X
ClrHome
Output(4,4,"MATCH NUL
Output(8,2,CREATED BY SEB
Pause
Goto W
voici un jeu de slalom
Code
0Q
ClrHome
1B
3C
8E
3F
4A
While 1
If E=1
Then
If AF+1
Goto 5
Q+1Q
randInt(1,6F
16E
End
E-1E
Output(F,E,"
Output(F+2,E,"
If B=1
Then
If AC+1
Goto 5
Q+1Q
randInt(1,6C
16B
End
B-1B
Output(C,B,"
Output(C+2,B,"
getKey
If =25 and A2
A-1A
If =34 and A7
A+1A
Output(A,1,">
Output(A-1,1,"
Output(A+1,1,"
If =105
Pause
End
Lbl 5
Output(4,5,"PERDU!"
Output(5,2,"AVEC PTS"
Output(5,7,Q
Stop
un "circuit" qui ram un peut aussi
Code
0Q
Menu(" >>>RACE<<< ","FACILE",1,"MOYEN",2,"DIFFICILE",3
Lbl 1
5L
Goto 4
Lbl 2
3L
Goto 4
Lbl 3
2L
Lbl 4
ClrHome
9dim(L
8dim(L
{5,4,5,5,6,7,7,7}L
8B
8A
7H
While 1
For(X,1,8
L(X)L(X+1)
End
randInt(0,1R
If R=0:1R
LL
LL
R+L(2)L(1)
If L(1)=0:1L(1)
If L(1)=17-L:16-LL(1)
For(V,1,8
Output(V,L(V),"
Output(V,L(V),"*
Output(V,L(V)+L,"
Output(V,L(V)+L,"*
End
Q+1Q
getKey
If =24
Then
Output(8,A," "
A-1A
Output(8,L(8)+L,"*
End
If =26
Then
Output(8,A," "
A+1A
Output(8,L(8),"*
End
If =105
Pause
Output(8,A,"8"
If AL(8) or AL(8)+L
Goto 5
End
Lbl 5
Output(5,4,"PERDU!"
Output(6,2,"AVEC PTS"
Output(6,7,Q
Stop
tant aussi adepte du rubik's cube j'ai fait un programme pour le mlanger (notation internationale)
Code
0
Lbl A
Menu("SCRAMBLE","4 MOUVEMENTS",P,"8 MOUVEMENTS",U,"12 MOUVEMENTS",G,"16 MOUVEMENTS",W,"28 MOUVEMENTS",T,"QUITTER",Q
Lbl Q
ClrHome
Stop
Lbl P
5G
5H
Goto B
Lbl U
4G
6H
Goto B
Lbl G
3G
7H
Goto B
Lbl T
1G
7H
1
Goto B
Lbl W
1G
7H
Goto B
0E
Lbl B
ClrHome
For(B,G,H,2
For(C,1,16,4
Lbl R
randInt(1,6K
If E=K
Goto R
If K=1
Then
randInt(0,2A
If A=0
Output(B,C,"F
If A=1
Output(B,C,"F'
If A=2
Output(B,C,"F2
End
If K=2
Then
randInt(3,5A
If A=3
Output(B,C,"B
If A=4
Output(B,C,"B'
If A=5
Output(B,C,"B2
End
If K=3
Then
randInt(6,8A
If A=6
Output(B,C,"U
If A=7
Output(B,C,"U'
If A=8
Output(B,C,"U2
End
If K=4
Then
randInt(9,11A
If A=9
Output(B,C,"D
If A=10
Output(B,C,"D'
If A=11
Output(B,C,"D2
End
If K=5
Then
randInt(12,14A
If A=12
Output(B,C,"L
If A=13
Output(B,C,"L'
If A=14
Output(B,C,"L2
End
If K=6
Then
randInt(15,17A
If A=15
Output(B,C,"R
If A=16
Output(B,C,"R'
If A=17
Output(B,C,"R2
End
KE
End
End
Pause
If =1
Then
0
Goto G
End
Goto A
et aussi un chrono avec moyenne
Code
ClrHome
Output(8,2,"CREATED BY SEB
For(,1,8
For(V,1,16
Output(,V,"-"
Output(4,6,"RUBIK'S
Output(5,8,"CHRONO
End
End
ClrHome
0T
0W
0I
0Q
0R
0Y
0X
0C
0D 1A
0B
For(,1,8)
Output(,7,"!
End
Lbl K 1A
0B
0C
Lbl Z
getKeyC
If C=45
Then
ClrHome
Stop
End
If C0
Goto A
Goto Z
Lbl A
Output(4,4,":
A+1A
If A=60
Then
B+1B
0A
Output(4,5,"0
End
Output(4,2,B
Output(4,5,A
For(K,0,26)
sin(7)L
End
getKeyD
If D0
Goto P
Goto A
Lbl P
Y+1Y
T+1T
If Y=8
1Y
If Y1
Output(Y-1,8,"
If Y=1
Output(7,8,"
Output(Y,8,"
Output(Y,9,T
Output(Y,12,B
Output(Y,14,":
Output(Y,15,A
(B+(A/60))+II
W+1W
I/WM
int(MQ
((fPart(M))*60)R
Output(8,11," : "
Output(8,11,Q
Output(8,13,":
Output(8,14,R
Output(8,1,"MOYENNE :
Output(4,2,"0 :0
Goto K
et enfin un rvolver de systme d'quation 2 inconnues
Code
Lbl 1
ClrHome
0Q
Lbl 0
Output(7,1,"A X+B Y=C A'X+B'Y=C'
If Q=0
Then
Input "A=",A
Q+1Q
Goto 0
End
If Q=1
Then
Input "B=",B
Q+1Q
Goto 0
End
If Q=2
Then
Input "C=",C
Q+1Q
Goto 0
End
If Q=3
Then
Input "A'=",D
Q+1Q
Goto 0
End
If Q=4
Then
Input "B'=",E
Q+1Q
Goto 0
End
If Q=5
Input "C'=",F
If A*E=B*D
Then
ClrHome
Output(4,4,"IMPOSSIBLE PAS DE (UNIQUE)SOLUTION
0Q
Pause
Goto 1
End
(C*E-B*F)/(A*E-D*B)X
(A*F-C*D)/(A*E-D*B)Y
ClrHome
Output(4,1,"X=
Output(4,3,X
Output(5,1,"Y=
Output(5,3,Y
Output(8,2,"CREATED BY SEB
Stop
Autorisation : Membre
Nb de messages : 19
Inscrit le : Sam 31 Mai 2008, 15:10
Post le : Jeu 05 Jui 2008, 11:58
merci pour ces commentaires,
mais je ne suis pas si productif que a car j'ai fait tout ces 9 programmes en en 10 moi soit moins de 1 par moi ce qui n'est pas tellement^^
Autorisation : Membre
Nb de messages : 3370
Inscrit le : Sam 31 Dc 2005, 19:48
Post le : Ven 06 Jui 2008, 19:15
Pour ton morpion, je te conseil d'utiliser soit des variables soit des listes car on arrive vite faire des conomie d'octets:
L1(6 prend 3 octets et [A](3,2 en prend 5 donc sur un prog, le gain de vitesse est norme.
Autorisation : Membre
Nb de messages : 19
Inscrit le : Sam 31 Mai 2008, 15:10
Post le : Sam 07 Jui 2008, 12:37
ok merci pour cette simplification mais en faite je l'avais compliqu pour que l'expression du bas reste tout le temps, mais c'est vrai que ce n'est pas indispensable
Autorisation : Membre
Nb de messages : 3370
Inscrit le : Sam 31 Dc 2005, 19:48
Post le : Sam 07 Jui 2008, 13:15
En renvoyant tout le temps au label 0, tu les recris mais si tu ne met pas de ClrHome ou de symboles dessus, il n'y a aucune raisons pour que a s'efface.