Bon voila le 1er programme que je poste.
Dans le cadre de mes TPE je me suis amusé a faire un petit programme qui simule la trajectoire d'une balle de golf.
Code
:EffDessin:AxesNAff:EffEcr:Degré:0->Ymin:62->Ymax:9.81->G:0->C:0-S
:For(A,0,25
:Texte(A,40,"Golf
:End
:Pause
:0->Xmin
:entAléat(200,300->T
:arrondi(T+T/100*25,0)->Xmax
:Lbl 0
:S+1->S
:EffDessin
:Horizontale 0
:Ligne(T,15,T-15,12
:Ligne(T,9,T-15,12
:Ligne T,0,T,15
:Texte0,0,"<
:Texte(0,74,">
:Ligne(0,59,T,59
:Texte(0,79,T,"M
:17->théta:0->V
:Repeat K=105
:codeTpuche->K
:max(17,min(25,théta+(K=26)-(K=24)->théta
:Texte(7,35,"ANGLE:",théta
:End
:0->K:1->V:1->L
:Texte(7,10,"VITESSE (M.S-1):
:Repeat K=105
:codetouche->K
:Pxl-Change(15,V
:V+L->V
:If V=70 ou V=0:-L->L
:Texte(9,70,V,"M.S-1 "
:End
:(-.5G)/(V²cos(théta)²)->A
:tan(théta)->B
:0->C:B²-(4AC)->D
:(-B-racine carré(D))/(2A)->E
:(-B+racine carré(D))/(2A)->F
:For(X,F,E,(Xmax-Xmin)/92
:((-.5GX²)/(V²cos(théta)²))+Xtan(théta)+C->Y
:arrondi(62-Y,0)->Y
:arrondi(x/(Xmax-Xmin)*92,0->Z
:If Z=<94:Pxl-On(Y,Z
:End
:Texte(17,0,E
:Pause
:If arrondi(E,0)=T ou partEnt(E)=T:Goto 3
:Goto 0
:Lbl 3
:Disp "gagner,S
Il reste pas mal de chose a faire (notamment une fin plus jolis, faire de façon a reprendre la balle ou elle est tombé et si possible mettre du relief)