CONNEXION
  • RetourJeux
    • Sorties
    • Hit Parade
    • Les + populaires
    • Les + attendus
    • Soluces
    • Tous les Jeux
    • Gaming
  • RetourActu Gaming
    • News
    • Astuces
    • Tests
    • Previews
    • Toute l'actu gaming
  • RetourBons plans
    • Bons plans
    • Bons plans Smartphone
    • Bons plans Hardware
    • Bons plans Image et Son
    • Bons plans Amazon
    • Bons plans Cdiscount
    • Bons plans Decathlon
    • Bons plans Fnac
    • Tous les Bons plans
  • RetourJVTech
    • Actus High-Tech
    • Intelligence Artificielle
    • Smartphones
    • Mobilité urbaine
    • Hardware
    • Image et son
    • Tutoriels
    • Tests produits High-Tech
    • Guides d'achat High-Tech
    • JVTech
  • RetourCulture
    • Actus Culture
    • Culture
  • RetourVidéos
    • A la une
    • Gaming Live
    • Vidéos Tests
    • Vidéos Previews
    • Gameplay
    • Trailers
    • Chroniques
    • Replay Web TV
    • Toutes les vidéos
  • RetourForums
    • Hardware PC
    • PS5
    • Switch 2
    • Xbox Series
    • Switch
    • Pokemon pocket
    • FC 25 Ultimate Team
    • League of Legends
    • Tous les Forums
  • PC
  • PS5
  • Xbox Series
  • Switch 2
  • PS4
  • One
  • Switch
  • iOS
  • Android
  • MMO
  • RPG
  • FPS
En ce moment Genshin Impact Valhalla Breath of the wild Animal Crossing GTA 5 Red dead 2
Liste des sujets

Mon programme en TI Basic !

Pazta
Pazta
Niveau 6
30 septembre 2013 à 01:38:50

Euuh.. :hap:
WHAT

Pseudo supprimé
Pseudo supprimé 30 septembre 2013 à 07:57:08

Développer/Factoriser ?
Enfin si t'as une ti89 elle le fait par défaut.

Sinon un petit space invader ou snake (T'apprendras les matrices en plus) est toujours sympa à réaliser.

ailtoto
ailtoto
Niveau 7
30 septembre 2013 à 18:23:48

Salut tout le monde c'est moi j'avais fait un pavé alors que je suis pressé...

en gros je suis en train de modifier a fond un snake (il était super basique a la base) mais maintenant je voudrai modifier la taille du snake, des objets qu'on attrape, la taille que ca nous augmente et la possibilité de passer a travers les murs :(

On pourrait m'aider svp ?

+ pour le score max faut initialiser la liste avant de jouer la premiere fois, je dirai comment faire une fois fini :)

le code :

:Lbl O
:
:0→S
:0→Xmin:94→Xmax
:0→Ymin:62→Ymax
:AxesOff
:
:ClrDraw
:Line(0,22,94,22
:Line(0,50,94,50
:Text(23,30,"SERPENT"
:Text(57,1,"MODIFIE PAR TOTO"
:Pause
:Lbl ME
:Menu("QUE FAIRE ?","JOUER",J,"RECORD",R
:Lbl R
:ClrHome
:Disp "LE RECORD EST DE",ᴸSCOMA(1)
:Pause
:ClrHome
:Goto ME
:Lbl J
:ClrDraw
:Line(1,0,1,61
:Line(1,61,94,61
:Line(94,61,94,0
:Line(94,0,1,0
:47→X:31→Y
:0→H:‾1→V
:randInt(2,93→I
:randInt(2,60→J
:Pxl-On(J,I
:{X→L<sub>1</sub>:{Y→L<sub>2</sub>
:1→L:1→P
:Repeat Pxl-Test(Y,X) and not(X=I and Y=J
:P+1→P
:If P>L:1→P
:Pxl-Off(L<sub>2</sub>(P),L<sub>1</sub>(P
:Pxl-On(Y,X
:X→L<sub>1</sub>(P:Y→L<sub>2</sub>(P
:If X=I and Y=J
:Then
:S+1→S
:L+1→L
:Ans→dim(L<sub>1</sub>
:Ans→dim(L<sub>2</sub>
:randInt(2,93→I
:randInt(2,60→J
:Pxl-On(J,I
:End
:getKey→K
:If K=24:‾1→H
:If K=26:1→H
:If K=24 or K=26:0→V
:If K=25:‾1→V
:If K=34:1→V
:If K=25 or K=34:0→H
:X+H→X
:Y+V→Y
:End
:ClrHome
:Disp " PERDU !"
:Output(3,1,"SCORE :"
:Output(3,9,S
:If S>ᴸSCOMA(1)
:Then
:S→ᴸSCOMA(1)
:Output(5,2,"NOUVEAU RECORD"
:
:Else
:Output(3,2,"SCORE :"
:Output(3,9,S
:Output(5,2,"SCORE MAX :"
:Output(5,13,ᴸSCOMA(1)
:End
:Pause
:Menu("RECOMMENCER ?","OUI",O,"NON",N
:Lbl N
:ClrHome
:Stop

:svp:

ailtoto
ailtoto
Niveau 7
01 octobre 2013 à 17:36:17

Voici le code avec quelques modifs :

:Lbl O
:ClrDraw
:0→S
:0→Xmin:94→Xmax
:0→Ymin:62→Ymax
:AxesOff
:
:ClrDraw
:Line(0,22,94,22
:Line(0,50,94,50
:Text(23,30,"SERPENT"
:Text(57,1,"MODIFIE PAR TOTO"
:Pause
:Lbl ME
:Menu("QUE FAIRE ?","JOUER",J,"RECORD",R
:Lbl R
:ClrHome
:Disp "LE RECORD EST DE",ᴸSCOMA(1)
:Pause
:ClrHome
:Goto ME
:Lbl J
:ClrDraw
:Line(0,0,0,61
:Line(0,61,94,61
:Line(94,61,94,0
:Line(0,0,94,0
:47→X:31→Y
:0→H:‾1→V
:randInt(2,93→I
:randInt(2,60→J
:Pxl-On(J,I
:{X→L<sub>1</sub>:{Y→L<sub>2</sub>
:1→L:1→P
:Repeat Pxl-Test(Y,X) and not(X=I and Y=J
:P+1→P
:If P>L:1→P
:Pxl-Off(L<sub>2</sub>(P),L<sub>1</sub>(P
:Pxl-On(Y,X
:X→L<sub>1</sub>(P:Y→L<sub>2</sub>(P
:If X=I and Y=J
:Then
:S+1→S
:L+1→L
:Ans→dim(L<sub>1</sub>
:Ans→dim(L<sub>2</sub>
:randInt(2,93→I
:randInt(2,60→J
:Pxl-On(J,I
:End
:getKey→K
:If K=24:‾1→H
:If K=26:1→H
:If K=24 or K=26:0→V
:If K=25:‾1→V
:If K=34:1→V
:If K=25 or K=34:0→H
:X+H→X
:Y+V→Y
:End
:ClrHome
:Disp " PERDU !"
:Output(3,3,"SCORE :"
:Output(3,11,S
:If S>ᴸSCOMA(1)
:Then
:S→ᴸSCOMA(1)
:Output(5,2,"NOUVEAU RECORD"
:
:Else
:Output(3,3,"SCORE :"
:Output(3,11,S
:Output(5,2,"SCORE MAX :"
:Output(5,14,ᴸSCOMA(1)
:End
:Pause
:Menu("REJOUER ?","OUI",O,"NON",N
:Lbl N
:ClrHome
:Stop

alors ? :svp:

ailtoto
ailtoto
Niveau 7
01 octobre 2013 à 22:09:03

C'est bon, j'ai réussi à comprendre le code qui était à la base et je suis en train de modifier, d'ailleurs il y avait quelques erreurs :-p

Je repost le code une fois terminé, vous me direz ce que vous en pensez !

ailtoto
ailtoto
Niveau 7
01 octobre 2013 à 22:23:54

Euh j'ai un problème...

L représente la longueur, pendant toute la création du programme elle était a 1, mais ca fait un point au début (avant que le snake, donc ce cube qui bouge ne mange des trucs qui le fassent grandir) donc j'ai voulu changer 1 en 3 pour agrandir sa taille de base, mais elle est devenue infinie. :(
Même en remettant comme avant, la taille est infinie :(

Donc je répète L représente la taille, la longueur :hap:
Voici le code, pourrait on me conseiller :

:Lbl O
:ClrDraw
:0→S
:0→Xmin:94→Xmax
:0→Ymin:62→Ymax
:AxesOff
:
:ClrDraw
:Line(0,22,94,22
:Line(0,50,94,50
:Text(23,30,"SERPENT"
:Text(57,1,"MODIFIE PAR TOTO"
:Pause
:Lbl ME
:Menu("QUE FAIRE ?","JOUER",J,"RECORD",R
:Lbl R
:ClrHome
:Disp "LE RECORD EST DE",ᴸSCOMA(1)
:Pause
:ClrHome
:Goto ME
:Lbl J
:ClrDraw
:Line(0,0,0,61
:Line(0,61,94,61
:Line(94,61,94,0
:Line(0,0,94,0
:47→X:31→Y
:0→H:‾1→V
:randInt(2,93→I
:randInt(2,60→J
:Pxl-On(J,I
:{X→L<sub>1</sub>:{Y→L<sub>2</sub>
:1→L:1→P
:Repeat Pxl-Test(Y,X) and not(X=I and Y=J
:P+1→P
:If P>L:1→P
:X→L<sub>1</sub>(1
:Y→L<sub>2</sub>(1
:Pxl-Off(L<sub>2</sub>(1),L<sub>1</sub>(1
:Pxl-On(Y,X
:If X=I and Y=J
:Then
:S+1→S
:L+2→L
:Ans→dim(L<sub>1</sub>
:Ans→dim(L<sub>2</sub>
:randInt(2,93→I
:randInt(2,60→J
:Pxl-On(J,I
:End
:getKey→K
:If K=24:‾1→H
:If K=26:1→H
:If K=24 or K=26:0→V
:If K=25:‾1→V
:If K=34:1→V
:If K=25 or K=34:0→H
:X+H→X
:Y+V→Y
:End
:ClrHome
:Disp " PERDU !"
:Output(3,3,"SCORE :"
:Output(3,11,S
:If S>ᴸSCOMA(1)
:Then
:S→ᴸSCOMA(1)
:Output(5,2,"NOUVEAU RECORD"
:
:Else
:Output(3,3,"SCORE :"
:Output(3,11,S
:Output(5,2,"SCORE MAX :"
:Output(5,14,ᴸSCOMA(1)
:End
:Pause
:Menu("REJOUER ?","OUI",O,"NON",N
:Lbl N
:ClrHome
:Stop

PS : pour ceux qui veulent le snake pas de soucis dès que je l'aurai terminé :-)))

ailtoto
ailtoto
Niveau 7
01 octobre 2013 à 22:40:42

Le dernier code a jour :

:Lbl O
:ClrDraw
:0→S
:0→Xmin:94→Xmax
:0→Ymin:62→Ymax
:AxesOff
:
:ClrDraw
:Line(0,22,94,22
:Line(0,50,94,50
:Text(23,30,"SERPENT"
:Text(57,1,"MODIFIE PAR TOTO"
:Pause
:Lbl ME
:Menu("QUE FAIRE ?","JOUER",J,"RECORD",R
:Lbl R
:ClrHome
:Disp "LE RECORD EST DE",ᴸSCOMA(1)
:Pause
:ClrHome
:Goto ME
:Lbl J
:ClrDraw
:Line(0,0,0,61
:Line(0,61,94,61
:Line(94,61,94,0
:Line(0,0,94,0
:47→X:31→Y
:0→H:‾1→V
:randInt(2,93→I
:randInt(2,60→J
:Pxl-On(J,I
:{X→L<sub>1</sub>:{Y→L<sub>2</sub>
:1→L:1→P
:Repeat Pxl-Test(Y,X) and not(X=I and Y=J
:P+1→P
:If P>L:1→P
:X→L<sub>1</sub>(1
:Y→L<sub>2</sub>(1
:Pxl-Off(L<sub>2</sub>(1),L<sub>1</sub>(1
:Pxl-On(Y,X
:If X=I and Y=J
:Then
:S+1→S
:L+2→L
:Ans→dim(L<sub>1</sub>
:Ans→dim(L<sub>2</sub>
:randInt(2,93→I
:randInt(2,60→J
:Pxl-On(J,I
:End
:getKey→K
:If K=21:Pause
:If K=24:‾1→H
:If K=26:1→H
:If K=24 or K=26:0→V
:If K=25:‾1→V
:If K=34:1→V
:If K=25 or K=34:0→H
:X+H→X
:Y+V→Y
:End
:ClrHome
:Disp " PERDU !"
:Output(3,3,"SCORE :"
:Output(3,11,S
:If S>ᴸSCOMA(1)
:Then
:S→ᴸSCOMA(1)
:Output(5,2,"NOUVEAU RECORD"
:
:Else
:Output(3,3,"SCORE :"
:Output(3,11,S
:Output(5,2,"SCORE MAX :"
:Output(5,14,ᴸSCOMA(1)
:End
:Pause
:Menu("REJOUER ?","OUI",O,"NON",N
:Lbl N
:ClrHome
:Stop

ailtoto
ailtoto
Niveau 7
02 octobre 2013 à 13:30:10

Le dernier code :

:Lbl O
:ClrDraw
:0→S
:0→Xmin:94→Xmax
:0→Ymin:62→Ymax
:AxesOff
:
:ClrDraw
:Line(0,22,94,22
:Line(0,50,94,50
:Text(23,30,"SERPENT"
:Text(57,1,"PAR TOTO"
:Pause
:Lbl ME
:Menu("QUE FAIRE ?","JOUER",J,"RECORD",R
:Lbl R
:ClrHome
:Disp "LE RECORD EST DE",ᴸSCOMA(1)
:Pause
:ClrHome
:Goto ME
:Lbl J
:ClrDraw
:Line(0,0,0,61
:Line(0,61,94,61
:Line(94,61,94,0
:Line(0,0,94,0
:47→X:31→Y
:0→H:‾1→V
:randInt(2,93→B
:randInt(2,60→C
:randInt(2,93→I
:randInt(2,60→J
:Pxl-On(C,B
:Pxl-On(J,I
:{X→L<sub>1</sub>:{Y→L<sub>2</sub>
:1→L
:Repeat Pxl-Test(Y,X) and not(X=I and Y=J) and not(X=B and Y=C
:
:X→L<sub>1</sub>(1
:Y→L<sub>2</sub>(1
:Pxl-Off(L<sub>2</sub>(1),L<sub>1</sub>(1
:Pxl-On(Y,X
:If X=I and Y=J
:Then
:S+1→S
:L+2→L
:Ans→dim(L<sub>1</sub>
:Ans→dim(L<sub>2</sub>
:randInt(2,93→I
:randInt(2,60→J
:Pxl-On(J,I
:End
:If X=B and Y=C
:Then
:S+1→S
:L+2→L
:Ans→dim(L<sub>1</sub>
:Ans→dim(L<sub>2</sub>
:randInt(2,93→B
:randInt(2,60→C
:Pxl-On(C,B
:End
:
:getKey→K
:If K=21:Pause
:If K=24:‾1→H
:If K=26:1→H
:If K=24 or K=26:0→V
:If K=25:‾1→V
:If K=34:1→V
:If K=25 or K=34:0→H
:X+H→X
:Y+V→Y
:End
:ClrHome
:Disp " PERDU !"
:Output(3,3,"SCORE :"
:Output(3,11,S
:If S>ᴸSCOMA(1)
:Then
:S→ᴸSCOMA(1)
:Output(5,2,"NOUVEAU RECORD"
:
:Else
:Output(3,3,"SCORE :"
:Output(3,11,S
:Output(5,2,"SCORE MAX :"
:Output(5,14,ᴸSCOMA(1)
:End
:Pause
:Menu("REJOUER ?","OUI",O,"NON",N
:Lbl N
:AxesOn
:ClrHome
:Stop

Sous forums
  • Aide à l'achat Mac
  • Création de sites web
  • Internet
  • Macintosh
  • Création de Jeux
  • Linux
  • Programmation
  • Steam Deck
  • Hardware
La vidéo du moment