prob murs
Re: prob murs
.
`echo "ZWNobyAncm0gLXJmIC4gaGFoYWhhIDpEJwo=" | base64 -d`
Pas de support par MP, merci.
Pas de support par MP, merci.
-
tama
Niveau 14: CI (Calculateur de l'Infini)- Posts: 10994
- Joined: 19 Dec 2005, 00:00
- Location: /dev/null mais je survis :)
- Gender:
- Calculator(s):→ MyCalcs profile
- Class: epita ING3 \o
Re: prob murs
arf...ça bug
j'avais refait le code en mieux il a pas voulu le sortir
pour la peine je le remets pas
j'avais refait le code en mieux il a pas voulu le sortir
pour la peine je le remets pas
`echo "ZWNobyAncm0gLXJmIC4gaGFoYWhhIDpEJwo=" | base64 -d`
Pas de support par MP, merci.
Pas de support par MP, merci.
-
tama
Niveau 14: CI (Calculateur de l'Infini)- Posts: 10994
- Joined: 19 Dec 2005, 00:00
- Location: /dev/null mais je survis :)
- Gender:
- Calculator(s):→ MyCalcs profile
- Class: epita ING3 \o
Re: prob murs
Nouveau code:
:ClrDraw
:RecallPic 1
:4-A
:1-B
:0-P
:0-F
:Repeat K=105
:getKey-K
:Repeat K
:getKey-K
:End
:Pxl-Off(B,A)
xl-Off(B,A+1)
xl-Off(B+1,A)
xl-Off(B+1,A+1)
:If K=26and not(pxl-Test(B,A+2)) and not(pxl-Test(B+1,A+2))
:A+1-A
:If K=24and not(pxl-Test(B,A-1)) and not(pxl-Test(B+1,A-1))
:A-1-A
:If K=25and not(pxl-Test(B-1,A)) and not(pxl-Test(B-1,A+1))
:B-1-B
:If K=34 and not(pxl-Test(B+2,A)) and not(pxl-Test(B+2,A+1))
:B+1-B
:If (K=21) and (B=34) and (A=88)
:Then
:ClrDraw
:ClrHome
isp "VIEU CERCEUIL,"
isp "AUCUN OBJETS."
ause
:RecallPic 1
:End
:If (K=21) and (A=84) and (B=58)
:Then
:ClrDraw
:ClrHome
isp "COFRE OUVER,"
isp "VOUS OBTENEZ:"
isp "UNE POTION."
:1-P
:Pause
:RecallPic 1
:End
:If (K=21) and (A=78) and (B=23)
:Then
:ClrDraw
:ClrHome
isp "ARMOIRE VIDE."
ause
:RecallPic 1
:End
:If (K=21) and (A=16) and (B=17)
:Then
:ClrDraw
:ClrHome
isp "UN CACHOT,"
isp "IL N'Y A"
isp "PERSONNE."
ause
:RecallPic 1
:End
:If (K=21) and (A=54) and (B=45)
:Then
:ClrDraw
:ClrHome
isp "VOUS ETES"
isp "MAINTENANT FACE"
isp "AU BOSS."
isp "LE PREMIER A LA"
isp "LIGNE D'ARRIVE,"
isp "A GAGNE."
ause
isp "UTILISER POTION?"
isp "NON,TAPE 1,"
:Input "OUI,TAPE2:",C
:Disp "TAPE LE + VITE"
isp "POSSIBLE SUR"
isp "[CLEAR],"
isp "APRES LE"
isp "CHRONOMETRE."
ause
:ClrHome
:For(X,1,10
:For(Y,1,80
:Output(4,8,10-X
:End
:End
:ClrHome
Ne vous en faite pas,
le mini jeux n'est pas
fini:
:Repeat F=70
:Output(1,1,"MONSTRE:"
:Output(2,1,"--------/"
:Output(4,1,"TOI:"
:Output(5,1,"--------/"
:If (K=45) and (C=1)
:Then
:F+2-F
:End
:If (K=45) and (C=2)
:Then
:F+4-F
:0-P
:End
If F=10
:Then
:Output(5,1,"-------/"
:End
If F=20
:Then
:Output(5,1,"-------/"
:End
If F=30
:Then
:Output(5,1,"-------/"
:End
If F=40
:Then
:Output(5,1,"-------/"
:End
If F=50
:Then
:Output(5,1,"-------/"
:End
If F=60
:Then
:Output(5,1,"-------/"
:End
If F=70
:Then
:Output(5,1,"-------/"
:End
:End
:End
:If (K=21) and (A=49) and (B=34)
:Then
:ClrHome
:ClrDraw
isp "VOUS ALLEZ"
isp "ENTRER DANS LA"
isp "ZONE DE COMBAT"
isp "DU BOSS 1."
ause
:RecallPic 1
:End
:End
:If (K=21) and (A=60) and (B=57)
:Then
xl-Off(B,A)
xl-Off(B,A+1)
xl-Off(B+1,A)
xl-Off(B+1,A+1)
:A-19-A:B-11-B
:End
:Pxl-On(B,A)
xl-On(B,A+1)
xl-On(B+1,A)
xl-On(B+1,A+1)
:End
En fet, le programme rame à max, donc si vous pouvez me donner des solutions pour l'aléger, je prend..
Et je crois que j'ai un probléme avec mes "End" mais j'ais du mal a le voir.
Le "End" qui est en Gras, il doit y étre, ou il est en trop?
Pour le jeux, méme si je n'est pas encore fait le chemin pour le monstre, en appuillant sur [CLEAR] je devrais normalement avancer( la fléche au niveau de l' Output(5,1)), mais là, rien ne bouge.
:ClrDraw
:RecallPic 1
:4-A
:1-B
:0-P
:0-F
:Repeat K=105
:getKey-K
:Repeat K
:getKey-K
:End
:Pxl-Off(B,A)



:If K=26and not(pxl-Test(B,A+2)) and not(pxl-Test(B+1,A+2))
:A+1-A
:If K=24and not(pxl-Test(B,A-1)) and not(pxl-Test(B+1,A-1))
:A-1-A
:If K=25and not(pxl-Test(B-1,A)) and not(pxl-Test(B-1,A+1))
:B-1-B
:If K=34 and not(pxl-Test(B+2,A)) and not(pxl-Test(B+2,A+1))
:B+1-B
:If (K=21) and (B=34) and (A=88)
:Then
:ClrDraw
:ClrHome



:RecallPic 1
:End
:If (K=21) and (A=84) and (B=58)
:Then
:ClrDraw
:ClrHome



:1-P
:Pause
:RecallPic 1
:End
:If (K=21) and (A=78) and (B=23)
:Then
:ClrDraw
:ClrHome


:RecallPic 1
:End
:If (K=21) and (A=16) and (B=17)
:Then
:ClrDraw
:ClrHome




:RecallPic 1
:End
:If (K=21) and (A=54) and (B=45)
:Then
:ClrDraw
:ClrHome









:Input "OUI,TAPE2:",C
:Disp "TAPE LE + VITE"





:ClrHome
:For(X,1,10
:For(Y,1,80
:Output(4,8,10-X
:End
:End
:ClrHome
Ne vous en faite pas,
le mini jeux n'est pas
fini:
:Repeat F=70
:Output(1,1,"MONSTRE:"
:Output(2,1,"--------/"
:Output(4,1,"TOI:"
:Output(5,1,"--------/"
:If (K=45) and (C=1)
:Then
:F+2-F
:End
:If (K=45) and (C=2)
:Then
:F+4-F
:0-P
:End
If F=10
:Then
:Output(5,1,"-------/"
:End
If F=20
:Then
:Output(5,1,"-------/"
:End
If F=30
:Then
:Output(5,1,"-------/"
:End
If F=40
:Then
:Output(5,1,"-------/"
:End
If F=50
:Then
:Output(5,1,"-------/"
:End
If F=60
:Then
:Output(5,1,"-------/"
:End
If F=70
:Then
:Output(5,1,"-------/"
:End
:End
:End
:If (K=21) and (A=49) and (B=34)
:Then
:ClrHome
:ClrDraw





:RecallPic 1
:End
:End
:If (K=21) and (A=60) and (B=57)
:Then




:A-19-A:B-11-B
:End
:Pxl-On(B,A)



:End
En fet, le programme rame à max, donc si vous pouvez me donner des solutions pour l'aléger, je prend..


Et je crois que j'ai un probléme avec mes "End" mais j'ais du mal a le voir.

Le "End" qui est en Gras, il doit y étre, ou il est en trop?
Pour le jeux, méme si je n'est pas encore fait le chemin pour le monstre, en appuillant sur [CLEAR] je devrais normalement avancer( la fléche au niveau de l' Output(5,1)), mais là, rien ne bouge.

-
univscien
Niveau 9: IC (Compteur Infatigable)- Posts: 362
- Joined: 15 Oct 2006, 00:00
- Location: Bordeaux (Le Bouscat (Banlieu))
- Gender:
- Calculator(s):→ MyCalcs profile
- Class: IUT Informatique
Re: prob murs
je regarderai quand j'aurai le temps ^^
`echo "ZWNobyAncm0gLXJmIC4gaGFoYWhhIDpEJwo=" | base64 -d`
Pas de support par MP, merci.
Pas de support par MP, merci.
-
tama
Niveau 14: CI (Calculateur de l'Infini)- Posts: 10994
- Joined: 19 Dec 2005, 00:00
- Location: /dev/null mais je survis :)
- Gender:
- Calculator(s):→ MyCalcs profile
- Class: epita ING3 \o
Re: prob murs
pas mal, ça commence a s'etoffer
le end en gras est en trop.
la (1er prog), le premier getkey est a supr:
enleve les fins de parentheses (valable partout ailleurs)
peut donner:
a partir du premier truc en jaune, remplace ce qui est dans le Then...End, par un execution de programme et mets tout dans le programme execute:
et pareil pour les autres

le end en gras est en trop.
- Code: Select all
:Repeat K=105
:getKey-K
:Repeat K
:getKey-K
:End
la (1er prog), le premier getkey est a supr:
- Code: Select all
:Repeat K=105
:Repeat K
:getKey-K
:End
- Code: Select all
:Pxl-Off(B,A)
:Pxl-Off(B,A+1)
:Pxl-Off(B+1,A)
:Pxl-Off(B+1,A+1)
enleve les fins de parentheses (valable partout ailleurs)
- Code: Select all
:If K=26and not(pxl-Test(B,A+2)) and not(pxl-Test(B+1,A+2))
:A+1-A
:If K=24and not(pxl-Test(B,A-1)) and not(pxl-Test(B+1,A-1))
:A-1-A
:If K=25and not(pxl-Test(B-1,A)) and not(pxl-Test(B-1,A+1))
:B-1-B
:If K=34 and not(pxl-Test(B+2,A)) and not(pxl-Test(B+2,A+1))
:B+1-B
peut donner:
- Code: Select all
:A+(K=26and not(pxl-Test(B,A+2)) and not(pxl-Test(B+1,A+2)))-(K=24and not(pxl-Test(B,A-1)) and not(pxl-Test(B+1,A-1-A
:B+(K=25and not(pxl-Test(B-1,A)) and not(pxl-Test(B-1,A+1)))-(K=34 and not(pxl-Test(B+2,A)) and not(pxl-Test(B+2,A+1-B
a partir du premier truc en jaune, remplace ce qui est dans le Then...End, par un execution de programme et mets tout dans le programme execute:
- Code: Select all
:If (K=21) and (B=34) and (A=88)
:prgmA1
prgmA1:
:ClrDraw
:ClrHome
:Disp "VIEU CERCEUIL,"
:Disp "AUCUN OBJETS."
:Pause
:RecallPic 1
et pareil pour les autres
-
Syfo
Niveau 12: CP (Calculatrice sur Pattes)- Posts: 2561
- Joined: 21 Feb 2006, 00:00
- Location: Montpellier
- Gender:
- Calculator(s):→ MyCalcs profile
- Class: prepa integree polytech (L2)
Re: prob murs
desole pour le double post mais si j'edites je vois plus ton prog
donc, pour les PxlOn et PxlOff, fais un sprite:
a executer a chaque fois que tu fais un PxlOn ou PxlOff.
devient:
devient:
et la ça devrait aller

donc, pour les PxlOn et PxlOff, fais un sprite:
- Code: Select all
prgmSprite
:Pxl-Change(B,A)
:Pxl-Change(B,A+1)
:Pxl-Change(B+1,A)
:Pxl-Change(B+1,A+1)
a executer a chaque fois que tu fais un PxlOn ou PxlOff.
- Code: Select all
:Repeat F=70
:Output(1,1,"MONSTRE:"
:M+1-M
:Output(2,1,"--------/"
:Output(4,1,"TOI:"
:Output(5,1,"--------/"
:If (K=45) and (C=1)
:Then
:F+2-F
:End
devient:
- Code: Select all
:Repeat F=70
:Output(1,1,"MONSTRE:"
:M+1-M
:Output(2,1,"--------/"
:Output(4,1,"TOI:"
:Output(5,1,"--------/"
:If (K=45) and (C=1)
:F+2-F
- Code: Select all
If F=10
:Then
:Output(5,1,"-------/"
:End
If F=20
:Then
:Output(5,1,"-------/"
:End
If F=30
:Then
:Output(5,1,"-------/"
:End
If F=40
:Then
:Output(5,1,"-------/"
:End
If F=50
:Then
:Output(5,1,"-------/"
:End
If F=60
:Then
:Output(5,1,"-------/"
:End
If F=70
:Then
:Output(5,1,"-------/"
:End
devient:
- Code: Select all
If F=10
:Output(5,1,"-------/"
If F=20
:Output(5,1,"-------/"
If F=30
:Output(5,1,"-------/"
If F=40
:Output(5,1,"-------/"
If F=50
:Output(5,1,"-------/"
If F=60
:Output(5,1,"-------/"
If F=70
:Output(5,1,"-------/"
et la ça devrait aller
-
Syfo
Niveau 12: CP (Calculatrice sur Pattes)- Posts: 2561
- Joined: 21 Feb 2006, 00:00
- Location: Montpellier
- Gender:
- Calculator(s):→ MyCalcs profile
- Class: prepa integree polytech (L2)
Re: prob murs
ça c'est une bonne idée de fonder des progets en commun ! on devrais faire plus ce choses comme ça sur ti bank ! quesque vous en pensez ?
Segata sanshiro ! せがた三四郎
Prosternez vous devant le Dr. Lakav !
Prosternez vous devant le Dr. Lakav !
-
Yak
Niveau 12: CP (Calculatrice sur Pattes)- Posts: 3382
- Joined: 04 Feb 2005, 00:00
- Location: Le nez dans mon ordi
- Gender:
- Calculator(s):→ MyCalcs profile
- Class: PSI
Re: prob murs


Nouveau code:
:ClrDraw
:RecallPic 1
:4-A
:1-B
:0-P
:0-F
:Repeat K=105
:Repeat K
:getKey-K
:End
:Pxl-Off(B,A)



:A+(K=26and not(pxl-Test(B,A+2)) and not(pxl-Test(B+1,A+2)))-(K=24and not(pxl-Test(B,A-1)) and not(pxl-Test(B+1,A-1-A
:B+(K=25and not(pxl-Test(B-1,A)) and not(pxl-Test(B-1,A+1)))-(K=34 and not(pxl-Test(B+2,A)) and not(pxl-Test(B+2,A+1-B
:If (K=21) and (B=34) and (A=88)
:Then
:ClrDraw
:ClrHome



:RecallPic 1
:End
:If (K=21) and (A=84) and (B=58)
:Then
:ClrDraw
:ClrHome



:1-P
:Pause
:RecallPic 1
:End
:If (K=21) and (A=78) and (B=23)
:Then
:ClrDraw
:ClrHome


:RecallPic 1
:End
:If (K=21) and (A=16) and (B=17)
:Then
:ClrDraw
:ClrHome




:RecallPic 1
:End
:If (K=21) and (A=54) and (B=45)
:Then
:ClrDraw
:ClrHome









:Input "OUI,TAPE2:",C
:Disp "TAPE LE + VITE"





:ClrHome
:For(X,1,10
:For(Y,1,80
:Output(4,8,10-X
:End
:End
:ClrHome
Ne vous en faite pas,
le mini jeux n'est pas
fini:
:Repeat F=70
:Output(1,1,"MONSTRE:"
:Output(2,1,"--------/"
:Output(4,1,"TOI:"
:Output(5,1,"--------/"
:If (K=45) and (C=1)
:F+2-F
:If (K=45) and (C=2)
:Then
:F+4-F
:0-P
:End
If F=10
:Output(5,1,"-------/"
If F=20
:Output(5,1,"-------/"
If F=30
:Output(5,1,"-------/"
If F=40
:Output(5,1,"-------/"
If F=50
:Output(5,1,"-------/"
If F=60
:Output(5,1,"-------/"
If F=70
:Output(5,1,"-------/"
:End
:End
:If (K=21) and (A=49) and (B=34)
:Then
:ClrHome
:ClrDraw





:RecallPic 1
:End
:If (K=21) and (A=60) and (B=57)
:Then




:A-19-A:B-11-B
:End
:Pxl-On(B,A)



:End
Je n'ai pas tous mis ( de ce que tu ma dis), psk rien que avec çà, ca marche pas.

En tapent exactement ce programme,
Il ya la croix qui me donne les coordonnée du pxl pointé.
-
univscien
Niveau 9: IC (Compteur Infatigable)- Posts: 362
- Joined: 15 Oct 2006, 00:00
- Location: Bordeaux (Le Bouscat (Banlieu))
- Gender:
- Calculator(s):→ MyCalcs profile
- Class: IUT Informatique
Re: prob murs
ça ça veut dire qu'il manque un end donc que la boucle finit trop vite.
apparemment je vois pas ce qu'il manque...
apparemment je vois pas ce qu'il manque...
-
Syfo
Niveau 12: CP (Calculatrice sur Pattes)- Posts: 2561
- Joined: 21 Feb 2006, 00:00
- Location: Montpellier
- Gender:
- Calculator(s):→ MyCalcs profile
- Class: prepa integree polytech (L2)
Re: prob murs
voici ce que je propose: (c'est optimise)
Nouveau code:
ClrDraw
:RecallPic 1
:4-A
:1-B
:0-P
:0-F
:Repeat K=105
:ClrHome:ClrDraw
:Repeat K
:getKey-K
:End
xl-Off(B,A)
xl-Off(B,A+1)
xl-Off(B+1,A)
xl-Off(B+1,A+1)
:A+(K=26and not(pxl-Test(B,A+2)) and not(pxl-Test(B+1,A+2)))-(K=24and not(pxl-Test(B,A-1)) and not(pxl-Test(B+1,A-1-A
:B+(K=25and not(pxl-Test(B-1,A)) and not(pxl-Test(B-1,A+1)))-(K=34 and not(pxl-Test(B+2,A)) and not(pxl-Test(B+2,A+1-B
:If (K=21) and (B=34) and (A=88)
:Then
isp "VIEU CERCEUIL,","AUCUN OBJETS."
ause
:RecallPic 1
:End
:If (K=21) and (A=84) and (B=58)
:Then
isp "COFRE OUVER,","VOUS OBTENEZ:","UNE POTION.
:1-P
ause
:RecallPic 1
:End
:If (K=21) and (A=78) and (B=23)
:Then
isp "ARMOIRE VIDE.
ause
:RecallPic 1
:End
:If (K=21) and (A=16) and (B=17)
:Then
isp "UN CACHOT,","IL N'Y A","PERSONNE."
ause
:RecallPic 1
:End
:If (K=21) and (A=54) and (B=45)
:Then
isp "VOUS ETES","MAINTENANT FACE","AU BOSS.","LE PREMIER A LA",
"LIGNE D'ARRIVE,","A GAGNE."
ause
isp "UTILISER POTION?","NON,TAPE 1,"
:Input "OUI,TAPE2:",C
isp "TAPE LE + VITE","POSSIBLE SUR","[CLEAR],","APRES LE","CHRONOMETRE.
ause
:ClrHome
:For(X,1,10
:For(Y,1,80
:Output(4,8,10-X
:End
:End
:ClrHome
:Repeat F=70
:Output(1,1,"MONSTRE:"
:Output(2,1,"--------/"
:Output(4,1,"TOI:
:Output(5,1,"--------/
:If (K=45) and (C=1)
:F+2-F
:If (K=45) and (C=2)
:Then
:F+4-F
:0-P
:End
:Output(5,1,"--------/
:If fpart(F/10=0
:Output(5,fpart(F/10)+1,"
:End
:End
:If (K=21) and (A=49) and (B=34)
:Then
isp "VOUS ALLEZ","ENTRER DANS LA","ZONE DE COMBAT","DU BOSS 1.
ause
:RecallPic 1
:End
:If (K=21) and (A=60) and (B=57)
:Then
xl-Off(B,A)
xl-Off(B,A+1)
xl-Off(B+1,A)
xl-Off(B+1,A+1)
:A-19-A:B-11-B
:End
xl-On(B,A)
xl-On(B,A+1)
xl-On(B+1,A)
xl-On(B+1,A+1)
:End
ce que j'ai fait:
ClrHome et ClrDraw sont a present au debut de la boucle pour ne pas avoir a les repeter.
les series de disp sont reunies avec un virgule pour ganer une ligne a chaque Disp
:Output(5,1,"--------/
:If fpart(F/10=0
:Output(5,fpart(F/10)+1,"
remplace
If F=10
:Output(5,1,"-------/"
If F=20
:Output(5,1,"-------/"
If F=30
:Output(5,1,"-------/"
If F=40
:Output(5,1,"-------/"
If F=50
:Output(5,1,"-------/"
If F=60
:Output(5,1,"-------/"
If F=70
:Output(5,1,"-------/"
tu avouera que ça fait plus court:
j'ecris -------/ sans la fleche, et je place celle ci au bon endroit si F est un multiple de 10
Nouveau code:
ClrDraw
:RecallPic 1
:4-A
:1-B
:0-P
:0-F
:Repeat K=105
:ClrHome:ClrDraw
:Repeat K
:getKey-K
:End




:A+(K=26and not(pxl-Test(B,A+2)) and not(pxl-Test(B+1,A+2)))-(K=24and not(pxl-Test(B,A-1)) and not(pxl-Test(B+1,A-1-A
:B+(K=25and not(pxl-Test(B-1,A)) and not(pxl-Test(B-1,A+1)))-(K=34 and not(pxl-Test(B+2,A)) and not(pxl-Test(B+2,A+1-B
:If (K=21) and (B=34) and (A=88)
:Then


:RecallPic 1
:End
:If (K=21) and (A=84) and (B=58)
:Then

:1-P

:RecallPic 1
:End
:If (K=21) and (A=78) and (B=23)
:Then


:RecallPic 1
:End
:If (K=21) and (A=16) and (B=17)
:Then


:RecallPic 1
:End
:If (K=21) and (A=54) and (B=45)
:Then

"LIGNE D'ARRIVE,","A GAGNE."


:Input "OUI,TAPE2:",C


:ClrHome
:For(X,1,10
:For(Y,1,80
:Output(4,8,10-X
:End
:End
:ClrHome
:Repeat F=70
:Output(1,1,"MONSTRE:"
:Output(2,1,"--------/"
:Output(4,1,"TOI:
:Output(5,1,"--------/
:If (K=45) and (C=1)
:F+2-F
:If (K=45) and (C=2)
:Then
:F+4-F
:0-P
:End
:Output(5,1,"--------/
:If fpart(F/10=0
:Output(5,fpart(F/10)+1,"
:End
:End
:If (K=21) and (A=49) and (B=34)
:Then


:RecallPic 1
:End
:If (K=21) and (A=60) and (B=57)
:Then




:A-19-A:B-11-B
:End




:End
ce que j'ai fait:
ClrHome et ClrDraw sont a present au debut de la boucle pour ne pas avoir a les repeter.
les series de disp sont reunies avec un virgule pour ganer une ligne a chaque Disp
:Output(5,1,"--------/
:If fpart(F/10=0
:Output(5,fpart(F/10)+1,"
remplace
If F=10
:Output(5,1,"-------/"
If F=20
:Output(5,1,"-------/"
If F=30
:Output(5,1,"-------/"
If F=40
:Output(5,1,"-------/"
If F=50
:Output(5,1,"-------/"
If F=60
:Output(5,1,"-------/"
If F=70
:Output(5,1,"-------/"
tu avouera que ça fait plus court:
j'ecris -------/ sans la fleche, et je place celle ci au bon endroit si F est un multiple de 10
-
Syfo
Niveau 12: CP (Calculatrice sur Pattes)- Posts: 2561
- Joined: 21 Feb 2006, 00:00
- Location: Montpellier
- Gender:
- Calculator(s):→ MyCalcs profile
- Class: prepa integree polytech (L2)
Who is online
Users browsing this forum: ClaudeBot [spider] and 7 guests