Autorisation : Membre
Nb de messages : 84
Inscrit le : Dim 15 Mai 2011, 11:33
Posté le : Dim 22 Mai 2011, 18:06
Me revoilà avec un programme, déjà publié ici sous une autre forme, reprenant le concept de l'émission Des chiffres et des lettres. Ici , ça se joue seul, contrairement à la version de Stupid qui se joue à deux...
Ce programme est divisé en trois parties:
- CHIFFRES, le programme pour jouer aux chiffres
- LETTRES, le programme pour jouer aux lettres
- CHIFLETT, le programme pour reproduire une partie intégrale de chiffres et de lettres.
Les timings sont réglementaires (30 secondes pour les lettres, 45 pour les chiffres), le nombre de lettres aussi (10 lettres), ainsi que les scores (10 points pour les chiffres trouvés, 7 pour un compte approchant, et le nombre de lettres détermine le nombre de points).
Quand je l'avais créé, il y a 2 ans, le jeu était encore à 9 lettres; en avril 2010, c'est passé à 10, j'ai mis à jour en juin.
Le bloc de licence:
Code
prgmCHIFLETT, prgmCHIFFRES, prgmLETTRES - Des chiffres et des Lettres game (c) 2011 Corentin FERRY
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Les programmes:
Code
prgmCHIFFRES
CoordRect:CoordNAff:QuadNAff:AxesNAff:EtiqNAff:ExpNAff:EffDessin:FonctOff:GraphOff
Texte(8,12,"CHIFFRES ET LETTRES
Texte(1,15,"LE COMPTE EST BON
Texte(50,1,"000
For([theta],0,94
Pxl-On(43,[theta]:Pxl-On(47,[theta]:[theta]+1->[theta]
End
For([theta],47,63
Pxl-On([theta],14
End
For([theta],40,95
Pxl-On(58,[theta]
End
For([theta],47,58
Pxl-On([theta],27:Pxl-On([theta],40:Pxl-On([theta],53:Pxl-On([theta],66:Pxl-On([theta],79:Pxl-On([theta],92
End
{1,2,3,4,5,6,7,8,9,10,25,50,75,100->L1
EffVar [theta]While [theta]<75:[theta]+1->[theta]:End:EffVar [theta]
For(L,0,6
Texte(50,16,L1(entAléat1,14
For([theta],0,450:End
EffVar [theta]
End
While [theta]<50:[theta]+1->[theta]:End:EffVar [theta]
entAléat(100,999->N
partEnt(N/100->A
partEnt((N-100A)/10->B
N-(100A+10B->C
EffVar [theta]
EffVar T
While [theta]<50:[theta]+1->[theta]:T+1->T
If T=10:1->T
Texte(50,1,T
End:EffVar [theta]
While [theta]<A
[theta]+1->[theta]
Texte(50,1,[theta]
End
EffVar [theta]
While [theta]<B
[theta]+1->[theta]
Texte(50,5,[theta]
End
EffVar [theta]
While [theta]<C
[theta]+1->[theta]
Texte(50,9,[theta]
End
EffVar [theta]
While [theta]<1436 et codeTouche[!=]105
[theta]+1->[theta]
Pxl-On(45,partEnt([theta]/1436)*93
End
EffVar [theta]
EffDessin
Menu("ALORS?","COMPTE BON",B,"APPROCHANT",A,"RIEN VU...",R
Lbl B
EffEcr
Disp "ENTREZ VOTRE
Disp "CALCUL EN UNE
Disp "SEULE EXPRESSION
Input V
If V=n:Then
S+9->S
Texte(1,1,"BRAVO!
Else
Texte(1,1,"TRICHEUR!
End
Pause
Goto R
Lbl A
S+6->S
Lbl R
If Z[!=]1024:Then
CoordRect:CoordAff:QuadNAff:AxesAff:EtiqNAff:ExpAff:EffDessin:FonctOn
End
Disp
Code
prgmLETTRES
CoordRect:CoordNAff:QuadNAff:AxesNAff:EtiqNAff:ExpNAff:FonctOff:GraphOff:EffDessin
Texte(8,12,"CHIFFRES ET LETTRES
Texte(1,15,"LE MOT LE PLUS LONG
For([theta],0,94
Pxl-On(43,[theta]:Pxl-On(47,[theta]:Pxl-On(58,[theta]
End
{1,5,5,5,9,15,21,25->L1
{2,3,4,6,7,8,10,11,12,12,12,12,12,12,12,13,14,
14,14,14,14,14,14,16,17,18,18,18,18,18,18,18,19,19,19,19,19,19,20,20,20,20,20,20,22,23,24,26->L2
Texte(20,1,"HAUT:CONSONNE
Texte(26,1,"BAS:VOYELLE
For([theta],47,58
Pxl-On([theta],0:Pxl-On([theta],9:Pxl-On([theta],18:Pxl-On([theta],27:Pxl-On([theta],36:Pxl-On([theta],45:Pxl-On([theta],54:Pxl-On([theta],63:Pxl-On([theta],72:Pxl-On([theta],81:Pxl-On([theta],90
End
"ABCDEFGHIJKLMNOPQRSTUVWXYZ->Chaîne0
EffVar [theta]
3->A
EffVar N
While [theta]<10
While non(N
codeTouche->N
End
If N=34:Then
Texte(50,A,sous-Chaîne(Chaîne0,L1(entAléat(1,dim(L1))),1:[theta]+1->[theta]:A+9->A
End
If N=25:Then
Texte(50,A,sous-Chaîne(Chaîne0,L1(entAléat(1,dim(L2))),1:[theta]+1->[theta]:A+9->A
End
EffVar N
End
EffVar N
EffVar [theta]
While [theta]<894 et codeTouche[!=]105
[theta]+1->[theta]
Pxl-On(45,partEnt([theta]/1436)*93
End
EffVar [theta]
EffDessin
Menu("ALORS?","UN MOT",M,"PAS DE MOT",R
Lbl M
EffEcr
Disp "COMBIEN
Disp "DE LETTRES?
Input L
If L[<=]10:Then
S+L->S
Else
Texte(1,1,"TRICHEUR!
Pause
End
Lbl R
If Z[!=]1024:Then
CoordRect:CoordAff:QuadNAff:AxesAff:EtiqNAff:ExpAff:EffDessin:FonctOn
End
Disp
Code
prgmCHIFLETT
CoordRect:CoordNAff:QuadNAff:AxesNAff:EtiqNAff:ExpNAff:FonctOff:GraphOff:1024->Z
EffDessin
EffVar S
Texte(1,1,"CHIFFRES ET LETTRES
Texte(8,1,"ENTREE: 1E COUP DE CHIFFRES
Pause
prgmCHIFFRES
Texte(8,1,"ENTREE: 1ER COUP DE LETTRES
Texte(20,1,"SCORE: ",S," POINTS
Pause
prgmLETTRES
Texte(8,1,"ENTREE: 2E COUP DE LETTRES
Texte(20,1,"SCORE: ",S," POINTS
Pause
prgmLETTRES
Texte(8,1,"ENTREE: 2E COUP DE CHIFFRES
Texte(20,1,"SCORE: ",S," POINTS
Pause
prgmCHIFFRES
Texte(8,1,"ENTREE: 3E COUP DE LETTRES
Texte(20,1,"SCORE: ",S," POINTS
Pause
prgmLETTRES
Texte(8,1,"ENTREE: 4E COUP DE LETTRES
Texte(20,1,"SCORE: ",S," POINTS
Pause
prgmLETTRES
Texte(1,1,"LES DUELS NE SONT PAS
Texte(7,1,"POSSIBLES, DONC REMPLACES
Texte(13,1,"PAR UN COUP DE CHIFFRES ET
Texte(19,1,"UN COUP DE LETTRES.
Texte(28,1,"ENTREE: 3E COUP DE CHIFFRES
Texte(36,1,"SCORE: ",S," POINTS
Pause
prgmCHIFFRES
Texte(8,1,"ENTREE: 5E COUP DE LETTRES
Texte(20,1,"SCORE: ",S," POINTS
Pause
prgmLETTRES
Texte(8,1,"ENTREE: 4E COUP DE CHIFFRES
Texte(20,1,"SCORE: ",S," POINTS
Pause
prgmCHIFFRES
Texte(8,1,"ENTREE: 6E COUP DE LETTRES
Texte(20,1,"SCORE: ",S," POINTS
Pause
prgmLETTRES
Texte(8,1,"ENTREE: 7E COUP DE LETTRES
Texte(20,1,"SCORE: ",S," POINTS
Pause
prgmLETTRES
Texte(8,1,"ENTREE: 5E COUP DE CHIFFRES
Texte(20,1,"SCORE: ",S," POINTS
Pause
prgmCHIFFRES
Texte(8,1,"ENTREE: 8E COUP DE LETTRES
Texte(20,1,"SCORE: ",S," POINTS
Pause
prgmLETTRES
Texte(8,1,"ENTREE: 9E COUP DE LETTRES
Texte(20,1,"SCORE: ",S," POINTS
Pause
prgmLETTRES
CoordRect:CoordAff:QuadNAff:AxesAff:EtiqNAff:ExpAff:FonctOn:EffEcr
Output(5,1,"SCORE FINAL:
Output(5,13,S
Pause
EffEcr
EffVar Z
Disp
Bonne prog à vous
edit: Corrigé un bug qui faisait planter le programme au moment de la sélection des lettres.
Autorisation : Membre
Nb de messages : 1387
Inscrit le : Ven 25 Mar 2011, 22:58
Posté le : Lun 23 Mai 2011, 10:03
Pour une fois une programme optimisé, c'est rare en version 1
J'ai trop la flème de tout recopier mais pour ceux qui aiment les jeux de mémoire,ça doit être pas mal.
Sandro
---------------------- mort à l'inutile, place à la mémoire libre et aux programmes
Autorisation : Membre
Nb de messages : 84
Inscrit le : Dim 15 Mai 2011, 11:33
Posté le : Lun 23 Mai 2011, 19:48
Citer : sandro
Pour une fois une programme optimisé, c'est rare en version 1
J'ai trop la flème de tout recopier mais pour ceux qui aiment les jeux de mémoire,ça doit être pas mal.
Sandro
Je l'ai optimisé avant de le recopier, il a 2 ans et l'original prend 2 fois plus de place (y'a que des While, aucun For qui est plus rapide...)