1

Bonjour/bonsoir, je vous présente ici la première version de mon projet pour le zContest 2011( reprise du message de la section projet + le PS + cette parenthèse).

Voici la présentation française (celle du site du concours)

Calcul exact par étapes      Auteur : sandro     Langage / Catégorie : TI-Basic Type : Programme 
Compatible : TI 82 STATS, TI 83, TI 83 Plus, TI 84 Plus. 

Voci un programme de calcul exact. Il s'effectue par étapes, chacune étant affichée (pratique pour les devoirs
de maths quand le prof demande les étapes intermédiaires).

Pour l'insant, ce programme ne gère que des résultats rationnels.

Les oppérations admises pour l'instant sont : l'addition, la soustraction, la multiplication, la division,
le carré, le cube, et l'inverse. Le programme gère également les parrenthèses et les fractions (sous
la forme {entier relatif:entier positif} ). Les constantes et autres oppérations ne sont pas accèptées pour l'instant.

A la fin, le programme affiche le résultat arrondit.

Pour afficher l'étape suivante, appuyez sur [entrer] ( [enter] ); si rien ne s'affiche de plus, c'est que la TI n'a
pas encore trouvée l'étape suivante.


Sandro


Voci les liens :
tromb Fichier joint : CALCAUTO.83p
tromb Fichier joint : _theta__theta_ADD.83p
tromb Fichier joint : _theta__theta_ADDF.83p
tromb Fichier joint : _theta__theta_CARCU.83p
tromb Fichier joint : _theta__theta_CARCUF.83p
tromb Fichier joint : _theta__theta_DETBC.83p
tromb Fichier joint : _theta__theta_DIV.83p
tromb Fichier joint : _theta__theta_DIVFPN.83p
tromb Fichier joint : _theta__theta_DIVPF.83p
tromb Fichier joint : _theta__theta_INV.83p
tromb Fichier joint : _theta__theta_MULT.83p
tromb Fichier joint : _theta__theta_MULTF.83p
tromb Fichier joint : _theta__theta_SIGNE.83p
tromb Fichier joint : _theta_DELPAR.83p
tromb Fichier joint : _theta_MONONIV.83p
tromb Fichier joint : _theta_NIVPAR.83p

Voici les codes :
programmeCALCAUTO (programme à lancer, veille à alterner entre le programme de calcul, et celui de supression de parrenthèses (pour l'instant très court, mais qui ce compliquera quand je rajouterrais les racines).

0 -> K
" " -> Str8
"{E,E -> L6
"{1,2 -> L5
Input "CALCUL:",Str0
Str0 -> Str6
"  "+Str0+"  " -> Str0
" " -> Str7
ClrHome
While Str7=/=Str0
Str0 -> Str7
prgm[théta]MONONIV
prgm[théta]DELPAR
End
sub(Str0,3,length(Str0)-4 -> Str9

1 -> A
While A
inString(Str9,"{",A -> A
If A:Then
"("+sub(Str9,A+1,length(Str9)-A -> Str2
If A=/=1
sub(Str9,1,A-1)+Str2 -> Str2
Str2 -> Str9
End
End

1 -> A
While A
inString(Str9,":",A+1 -> A
If A
sub(Str9,1,A-1)+"/"+sub(Str9,A+1,length(Str9)-A -> Str9
End

1 -> A
While A
inString(Str9,"}",A+1 -> A
If A
Then
sub(Str9,1,A-1)+")" -> Str2
If A=/=length(Str9
Str2+sub(Str9,A+1,length(Str9)-A -> Str2
Str2 -> Str9
End

Pause expr(Str9


programme[théta]NIVPAR  (trouve quels sont les "niveaux de parrenthèses" (combien siont ouverte à tel endroit) 
{0 -> L1
length(Str0 -> L
L -> dim(L1
For(A,1,L
sub(Str0,A,1 -> Str2
If Str2=")
-1 -> L1(A+1
If inString("(sin(cos(tan(sin-1(cos-1(tan-1([e^(][10^(][racine carré)[racine cube]Ýð(",Str2                    //les crochets servent juste pour signaler qu'il s'agit d'un seul et même symbol
1 -> L1(A+1
End
cumSum(L1 -> L2


programme[théta]MONONIV  (gère les sous-programmes propre à chaque oppération)

3 -> A
While A+3[inférieur ou égal]length(Str0
If Str8=/=Str0
Then
If K
Pause 
1 -> K
Disp sub(Str0,3,length(Str0)-4
Str0 -> Str8
End
A -> B
A+1 -> A
A+1 -> C
1 -> [théta]
sub(Str0,A,1 -> Str9
prgm[théta][théta]SIGNE
If Str9="+
prgm[théta][théta]ADD
If Str9="*
prgm[théta][théta]MULT
If Str9="[carré]
DelVar [théta]prgm[théta][théta]CARCU
If Str9="/
prgm[théta][théta]DIV
If Str9="[^-1]
prgm[théta][théta]INV
If Str9="[cube]
prgm[théta][théta]CARCU
End


programme[théta]DELPAR

If inString(Str0,"("
Then
1üB
While B
inString(Str0,"(",B+1 -> B
If B:B -> A
End

A -> B

1 -> C
B+1 -> A
While C
A+1 -> A
sub(Str0,A,1 -> Str2
If Str2=")
C-1 -> C
If inString("(sin(cos(tan(sin-1(cos-1(tan-1([10^(][e^(][racine carré][racine cube]",Str2
C+1 -> C
End
A -> C

sub(Str0,B+1,C-B-1 -> Str4


1 -> D
For(A,1,length(Str4
If not(inString("[moins des relatifs]0.123456789{:}",sub(Str4,A,1
0 -> D

If D
Then
sub(Str0,1,B-1)+Str4+sub(Str0,C+1,length(Str0)-C -> Str0
Return
End




sub(Str0,A-1,1 -> Str2
sub(Str0,B+1,1 -> Str3



programme[théta][théta]ADD (addition-soustraction)

"^/*) -> Str1
"^/*([inverse][carré][cube][pi]e -> Str7
If sub(Str0,A,2)="+{" or "}+"=sub(Str0,B,2
Then
1 -> X
prgm[théta][théta]ADDF
If not(X:Return
Else
prgm[théta][théta]DETBC
If not(X:Return

expr(Str2 -> E

LinReg(ax+b)L5,L6,Y9
Equ>String(Y9,Str2
sub(Str2,4,length(Str2)-3 -> Str2

End

sub(Str0,1,B)+Str2+sub(Str0,C,length(Str0)-C+1 -> Str0
1 -> A


programme[théta][théta]ADDF (addition et soustractions avec fraction)

1 -> X
prgm[théta][théta]DETBC
If not(X:Return

sub(Str0,B+1,A-B-1 -> Str2
sub(Str0,A+1,C-A-1 -> Str3

inString(Str2,": -> H
inString(Str3,": -> M

If H
Then
expr(sub(Str2,2,H-2 -> N
expr(sub(Str2,H+1,length(Str2)-H-1 -> O
Else
expr(Str2 -> N
1 -> O
End

If M
Then
expr(sub(Str3,2,M-2 -> P
expr(sub(Str3,M+1,length(Str3)-M-1 -> Q
Else
expr(Str3 -> P
1 -> Q
End

While fPart(N) or fPart(O
10N -> N
10O -> O
End
While fPart(P) or fPart(Q
10P -> P
10Q -> Q
End

gcd(abs(N),abs(O))^-1 -> H
NH -> N
OH -> O

gcd(abs(P),abs(Q))^-1 -> M
PM -> P
QM -> Q

OQ -> V
NQ+PO -> U

(-2(V<0)+1)gcd(abs(U),abs(V))^-1 -> W
UW -> U
VW -> V

U -> E
LinReg(ax+b)L5,L6,Y9
Equ>String(Y9,Str2
V -> E
LinReg(ax+b)L5,L6,Y9
Equ>String(Y9,Str3

If U=0
Then
"0 -> Str2
Else
sub(Str2,4,length(Str2)-3 -> Str2
If V=/=1
"{"+Str2+":"+sub(Str3,4,length(Str3)-3)+"} -> Str2



programme[théta][théta]CARCU           (carré et cube)

If "}"=sub(Str0,B,1
Then
prgm[théta][théta]CARCUF
Else

While Bø1 and inString("0.123456789à",sub(Str0,B,1
B-1 -> B
End
If ")"=sub(Str0,B,1
Return

If B=1:0 -> B

sub(Str0,B+1,A-B -> Str2

expr(Str2 -> E
LinReg(ax+b)L5,L6,Y9
Equ>String(Y9,Str2
sub(Str2,4,length(Str2)-3 -> Str2

End

sub(Str0,1,B)+Str2+sub(Str0,A+1,length(Str0)-A -> Str0
1 -> A


programme[théta][théta]CARCUF    (cube et carré de fractions)

While Bø1 and "{"øsub(Str0,B,1
B-1 -> B
End
B-1 -> B

If B=1:0 -> B

inString(Str0,":",B+2 -> H

sub(Str0,B+2,H-B-2 -> Str2
sub(Str0,H+1,A-H-2 -> Str3

expr(Str2)^(2+[theta]) -> E
LinReg(ax+b)L5,L6,Y9
Equ>String(Y9,Str2

expr(Str3)^(2+[theta]) -> E
LinReg(ax+b)L5,L6,Y9
Equ>String(Y9,Str3
"{"+sub(Str2,4,length(Str2)-3)+":"+sub(Str3,4,length(Str3)-3)+"}" -> Str2



PROGRAMME[théta][théta]DETBC      (calcule B et C, respectivement le rand du dernier carractère avant la chaîne exprimée et le premier après)

While Bø1 and inString("[le moins des relatifs]0.123456789à{:}",sub(Str0,B,1
B-1 -> B
End
If inString(Str1,sub(Str0,B,1
DelVar XReturn

If B=1:0 -> B

While Cølength(Str0) and inString("-0.123456789à{:}",sub(Str0,C,1
C+1 -> C
End
If inString(Str7,sub(Str0,C,1
DelVar XReturn

If C=length(Str0:C+1 -> C

sub(Str0,B+1,C-B-1 -> Str2


[théta][théta]DIV   (division d'un nombre décimal par un autre

"/^) -> Str1
"^([inverse][carré][cube][pi]e -> Str7                  //les crochets servent uniquement a marquer les carracteres speciaux
1 -> X
If "}"=sub(Str0,A-1,1) and inString("0.-123456789",sub(Str0,A+1,1
Then
prgm[theta][theta]DIVFPN
If not(X:Return
Else
If "/{"=sub(Str0,A,2
Then
prgm[thete][theta]DIVPF
If not(X:Return
Else

prgm[theta][theta]DETBC
If not(X:Return

expr(Str2 -> E
If not(fPart(E[E des puissances de 10]5
Then
LinReg(ax+b)L5,L6,Y9
Equ>String(Y9,Str2
sub(Str2,4,length(Str2)-3 -> Str2
Goto Q
End


sub(Str0,B+1,A-B-1 -> Str2
sub(Str0,A+1,C-A-1 -> Str3

expr(Str2 -> U
expr(Str3 -> V
While fPart(U) or fPart(V
10U -> U
10V -> V
End
(-2(V<0)+1)gcd(abs(U),abs(V))^-1 -> N
UN -> U
VN -> V
U -> E
LinReg(ax+b)L5,L6,Y9
Equ>String(Y9,Str2
V -> E
LinReg(ax+b)L5,L6,Y9
Equ>String(Y9,Str3

"{"+sub(Str2,4,length(Str2)-3)+":"+sub(Str3,4,length(Str3)-3)+"} -> Str2

Lbl Q

End
End

sub(Str0,1,B)+Str2+sub(Str0,C,length(Str0)-C+1 -> Str0
1 -> A


[théta][théta]DIVFPN           (division d'une fraction par un  un nombre)

prgm[theta][theta]DETBC
If not(X:Return

inString(Str0,":",B+1 -> H

sub(Str0,B+2,H-B-2 -> Str2
sub(Str0,H+1,A-H-2 -> Str3
sub(Str0,A+1,C-A-1 -> Str4

expr(Str2 -> U
expr(Str3 -> V
expr(Str4 -> W

VW -> V

(-2(V<0)+1)gcd(abs(U),abs(V))^-1 -> N
UN -> U
VN -> V

U -> E
LinReg(ax+b)L5,L6,Y9
Equ>String(Y9,Str2
sub(Str2,4,length(Str2)-3 -> Str2
V -> E
LinReg(ax+b)L5,L6,Y9
EquåString(Y9,Str3
sub(Str3,4,length(Str3)-3 -> Str3

If V=/=0
"{"+Str2+":"+Str3+"}" -> Str2 



programme[théta][théta]DIVPF            (division par une fraction)

inString(Str0,":",A+2 -> H
inString(Str0,"}",H+2 -> I
sub(Str0,A+2,H-A-2 -> Str2
sub(Str0,H+1,I-H-1 -> Str3
"*{"+Str3+":"+Str2+"}" -> Str2
I+1 -> C
If inString("^[^-1][^2][^3][pi](e",sub(Str0,C,1
DelVar X



programme[théta][théta]INV          (inverse d'un nombre)

While inString("[moins des relatifs]0.123456789{:}",sub(Str0,B,1
B-1 -> B
End

sub(Str0,B+1,A-B-1 -> Str4

inString(Str4,":" -> H

If H
Then
sub(Str4,2,H-2 -> Str2
sub(Str4,H+1,length(Str4)-H-1 -> Str3
expr(Str2 -> V
expr(Str3 -> U
Else
expr(Str4) -> V
1 -> U
End

While fPart(U) or fPart(V
10U -> U
10V -> V
End

(-2(U<0)+1)gcd(abs(U),abs(V))^-1 -> H
UH -> U
VH -> V

U -> E
LinReg(ax+b)L5,L6,Y9
Equ>String(Y9,Str2

V -> E
LinReg(ax+b)L5,L6,Y9
Equ>String(Y9,Str3

If U=0
Then
"0 -> Str2
Else
sub(Str2,4,length(Str2)-3 -> Str2
If V=/=1
"{"+Str2+":"+sub(Str3,4,length(Str3)-3)+"}" -> Str2
sub(Str0,1,B)+Str2+sub(Str0,A+1,length(Str0)-A -> Str0



programme[théta][théta]MULT           (multiplication)

"^)/ -> Str1
"^([^-1][^2][^3][pi]e -> Str7
1 -> X
If "}"=sub(Str0,A-1,1) or "{"=sub(Str0,A+1,1
Then
prgm[theta][theta]MULTF
If not(X:Return
Else
prgm[theta][theta]DETBC
If not(X:Return

expr(Str2 -> E
LinReg(ax+b)L5,L6,Y9
Equ>String(Y9,Str2
sub(Str2,4,length(Str2)-3 -> Str2

End


sub(Str0,1,B)+Str2+sub(Str0,C,length(Str0)-C+1 -> Str0
1 -> A




programme[théta][théta]MULTF         (multiplication avec fraction(s) )

While B=/=1 and inString(":{}-0.123456789",sub(Str0,B,1
B-1 -> B
End

If inString("^/)",sub(Str0,B,1
Return

If B=1:0 -> B

sub(Str0,B+1,A-B-1üStr2
inString(Str2,":" -> H

If H
Then

expr(sub(Str2,2,H-2 -> N

expr(sub(Str2,H+1,length(Str2)-H-1 -> O

Else

expr(Str2 -> N
1 -> O
While fPart(N
10N -> N
10O -> O
End
gcd(abs(N),O)^-1üG
NG -> N
OG -> O
End

A+1 -> C
While C=/=length(Str0) and inString(":{}-0.123456789",sub(Str0,C,1
C+1 -> C
End

If inString("^)sin(cos(tan(sin-1(cos-1(tan-1([pi]e[10^(][e^(][^-1][^2][^3][racine carre][racine cube] [racine X]",sub(Str0,C,1
DelVar XReturn

If C=length(Str0):C+1 -> C

sub(Str0,A+1,C-A-1 -> Str2
inString(Str2,":" -> H

If H
Then
expr(sub(Str2,2,H-2 -> P

expr(sub(Str2,H+1,length(Str2)-H-1 -> Q

Else

expr(Str2 -> P

1 -> Q
While fPart(P
10P -> P
10Q -> Q
End

gcd(abs(P),Q)^-1üG
PG -> P
QG -> Q
End


NP -> U
OQ -> V
(-2(V<0)+1)gcd(abs(U),abs(V))^-1üG
UG -> U
VG -> V

U -> E
LinReg(ax+b)L5,L6,Y9
Equ>String(Y9,Str2

sub(Str2,4,length(Str2)-3 -> Str2

V -> E
LinReg(ax+b)L5,L6,Y9
Eq>String(Y9,Str3
sub(Str3,4,length(Str3)-3 -> Str3

If U=0
Then
"0 -> Str2

Else

If V=/=1
"{"+Str2+":"+Str3+"}" -> Str2



programme[théta][théta]SIGNE         (transforme la soustraction en addition)

1 -> Y
While Y
inString(Str0,"[moins des soustractions]",Y -> Y
If Y
Then
If "{"=sub(Str0,Y+1,1
Then
sub(Str0,1,Y-1)+"+{[moins des relatifs]"+sub(Str0,Y+2,length(Str0)-Y-1 -> Str0
Else
sub(Str0,1,Y-1)+"+[moins des relatifs]"+sub(Str0,Y+1,length(Str0)-Y -> Str0
End
End
End




Sandro

PS : je vais essayer d'étandre aux réels, mais je n'ai pas encore trouvé la meilleure méthode.

2

Up !

Alors ces réels ? tripo

3

Pour l'instant c'est un gros désordre : je suis en train de refaire entièrement le programme affin de ne pas utiliser des chaînes mais des listes pour les calculs donc les réels y sont intégrés, mais pas testés (il ne sont pas encore pris en compte dans l'affichage donc je ne sais pas s'ils fonctionnent).

Sandro

4

Ok c'est en cours donc smile

5

Oui, mais je ne sais pas encore pour quand, j'ai encore des problèmes d'affichages, je pense qu'il y en a encore pour au moins 2 semaines avant la prochaine version.
Sandro

6

Des nouvelles, pas encore de nouvelle version?

7

pas encore, là j'ai beaucoup de boulot, mais je vais voir si j'ai le temps d'avencer un peut ce weekend (j'ai une fonction certe encore incomplette, mais si j'enlève le cossinus et que je m'ocupe enfin de l'affichage, je pense que j'aurais bientôt finit une version en apparence assez similaire, mais basée sur des listes (pas de parrenthèses par contre pour l'instant).

Sandro

8

[nosmile]C'est bon, j'ai réussit à optenir quelquechose d'à peu près correct (mais pas terminé, loins de là) en ayant tout restructuré (pas une seul sous programme est resté : j'ai remplacé les chaînes par des listes pour le stocage proncipal des infos):

Cette version gère pour l'instant :
-les 4 opérations de bases (+,-,*,/)
-les "unitées" : pi, e, i(mais sans la propriété i²=-1), X et Y : chacun avec un exposant entier de -10 à 10 fois une exposant en racines composé au maximum d'une racine carrée et une racine cube : rac2(rac3(?)); rac3(?); rac2(?); rac3(?)²; ou rac2(?)*rac3(?)
-les opérations d'exposant "préfètes" : carré, cube et inverse
-les fraction (mais pas en entrée) de forme {Z:N} (Z étant le numérateur : entier relatif et N le dénominateur : entier naturel)
-la trigo de base (radian) : cos, sin, tan avec les valeures usuelles sur R (simplification avec trig(x)=trig(x+2pi) )
-les racines carrés

Pas géré:
-un bon nombre de fonctions
-les dévelopement/réductions (sauf dans le cadre d'abscence de parrenthèses et d'adjacence dans l'ordre des opérations)
-les parrenthèses (ne génèrent pas de bug ou de non sens, mais elles ne sont pas prise en compte : on calcule ce qu'il y a avant, après et dedant, mais on ne regroupe pas les 3)
-les "déplacements de blocs" : on effectuera pas d'opérations avec des termes non adjacent : example : 7+3pi+8 ne sera pas calculé car on ne peut pas faire ni 7+3pi, ni 3pi+8
-la prise en compte du fait que i²=-1
-la suppression des parenthèsses inutiles

Voici les programmes (6014 octé pour l'instant (non optimié pour m'instant):
tromb Fichier joint : CALCLIST.83p
tromb Fichier joint : INTERFAC.83p
tromb Fichier joint : _theta_ADDSUB.83p
tromb Fichier joint : _theta_CARRE.83p
tromb Fichier joint : _theta_COS.83p
tromb Fichier joint : _theta_CUBE.83p
tromb Fichier joint : _theta_DISP.83p
tromb Fichier joint : _theta_DIV.83p
tromb Fichier joint : _theta_FACTP.83p
tromb Fichier joint : _theta_INV.83p
tromb Fichier joint : _theta_MULT.83p
tromb Fichier joint : _theta_OPS.83p
tromb Fichier joint : _theta_OPSPAR.83p
tromb Fichier joint : _theta_RAC2.83p
tromb Fichier joint : _theta_RACLIS1.83p
tromb Fichier joint : _theta_RACLIST.83p
tromb Fichier joint : _theta_SIN.83p
tromb Fichier joint : _theta_TAN.83p





Et les codes :
ProgrammeCALCLIST:
{1,2 -> lREG1
"{E+1,2E+1 -> lREG2
5 -> dim(lUNITE
prgmINTERFAC
prgmThétaDISP
Pause Str0
0 -> A
While A=/=dim(L1
A+1 -> A
Pause A
If L1(A)=2
prgmThétaOPS
If L1(A)=4
prgmThétaOPSPAR
End


ProgrammeINTERFAC
Input "CALCUL:",Str1
length(Str1üL
Lüdim(L
Fill(1,L
LüL‚
L‚üL„

L-LüLƒ
L„+L„àüL…
L…üL†

For(A,1,length(Str1
sub(Str1,A,1üStr2
If inString("ú.0123456789",Str2
1üL„(A

If inString("+-*/^ñÜÝ",Str2
2üL„(A

If Str2="(" or Str2=")"
3üL„(A

If inString("sin(cos(tan(sinñ(cosñ(tanñ(ln(log(ý^(ë^(ð(Ýð(",Str2
4üL„(A

If inString("ÄëàXY",Str2
5üL„(A

End


ÄëÄüL„(1+dim(L„


1üD
For(A,1,length(Str1
sub(Str1,A,1üStr2

If L„(A)=1
Then
AüB
While 1=L„(B+1
B+1üB
End
expr(sub(Str1,A,B-A+1üL‚(D
1üL(D
D+1üD
BüA
End

If L„(A)=2
Then
2üL(D
inString("+-*/^ñÜÝ",Str2üL‚(D
D+1üD
End

If L„(A)=3
Then
If Str2="(
1üL‚(D
If Str2=")
ú1üL‚(D
3üL(D
D+1üD
End

If L„(A)=4
Then
inString("cos(sin(tan(cosñ(sinñ(tanñ(ln(log(ý^(ë^(ð(Ýð(",Str2üL‚(D
4üL(D
D+1üD
End

If L„(A)=5
Then
6ý^(ú2+2inString("YXàëÄ",Str2üLƒ(D
D+1üD
End

End
D-1üD
Düdim(L
Düdim(L‚
Düdim(Lƒ
Düdim(L„
Fill(1,L„
Düdim(L…
Düdim(L†

For(A,1,dim(L
If L(A)=1 and fPart(L‚(A
Then
L‚(AüU
1üV
While fPart(round(U,9
10UüU
10VüV
End
gcd(abs(U),V)ñüR
URüL‚(A
VRüL„(A
End
End


ProgrammeThétaADDSUB
If A=1:Return
If L(A-1)ø1 or L(A+1)ø1
Return

If Lƒ(A+1)øLƒ(A-1)
Return

If Aø2
Then
If L(A-2)=2 and L‚(A-2)ø1 and L‚(A-2)ø2
Return
End

If A+1øD
Then
If L(A+2)=2 and L‚(A+2)ø1 and L‚(A+2)ø2
Return
End

L‚(A-1)*L„(A+1üS
L‚(A+1)*L„(A-1üT
S+TüU
If L‚(A)=2:S-TüU
L„(A-1)*L„(A+1üV
gcd(abs(U),V)ñüR
URüL‚(A-1
VRüL„(A-1

2üÁ
prgmÁRACLIST
A-2üA
If AùD
1üA


ProgrammeThétaCARRE
If L(A-1)=1
Then
(1-2(L‚(A-1)÷0))L‚(A-1)Üreal(L…(A-1üU
L„(A-1)Üimag(L…(A-1üV
gcd(abs(U),V)ñüR
URüL‚(A-1
VRüL„(A-1
2Lƒ(A-1üLƒ(A-1
real(L†(A-1))Ü+àimag(L†(A-1))ÜüL†(A-1

1üÁ
prgmÁRACLIS1
A-2üA


ProgrammeThétaCOS
A+1üB
If L(B)=1 and L(B+1)=3 and L‚(B+1)=ú1
Then
If L…(B)=1+à and L†(B)=1+à and (Lƒ(B)+0à=6û8+0à or L‚(B)=0
Then
abs(L‚(B)/L„(BüC
2fPart(.5CüC
If C>1:2-CüC
B+1üB

1üK

If C=0
Then
1üL(B
1üL‚(B
0üLƒ(B
0üK
End

If C=1/6
Then
1üL(B
1üL‚(B
0üLƒ(B
2üL„(B
3+àüL…(B
0üK
End

If C=1/4
Then
1üL(B
0üK
1üL‚(B
0üLƒ(B
2üL„(B
2+àüL…(B
End

If C=1/3
Then
1üL(B
1üL‚(B
0üLƒ(B
2üL„(B
0üK
End

If C=1/2
Then
1üL(B
0üL‚(B
0üLƒ(B
0üK
End

If C=1
Then
1üL(B
ú1üL‚(B
0üLƒ(B
0üK
End

If C=5/6
Then
1üL(B
ú1üL‚(B
0üLƒ(B
2üL„(B
3+àüL…(B
0üK
End

If C=3/4
Then
1üL(B
ú1üL‚(B
0üLƒ(B
2üL„(B
2+àüL…(B
0üK
End

If C=2/3
Then
1üL(B
ú1üL‚(B
0üLƒ(B
2üL„(B
0üK
End



If not(K
Then
2üÁ
prgmÁRACLIST
A-2üA


Programme ThétaCUBE
If L(A-1)=1
Then
L‚(A-1)Ýreal(L…(A-1))real(L†(A-1üU
L„(A-1)Ýimag(L…(A-1))imag(L†(A-1üV
gcd(abs(U),V)ñüR
URüL‚(A-1
VRüL„(A-1
2Lƒ(A-1üLƒ(A-1

1üÁ
prgmÁRACLIS1
A-2üA


Programme ThétaDISP
" üStr0
0üP
Repeat P=dim(L
P+1üP

If L(P)=1
Then
L‚(PüE
LinReg(ax+b)áREG1,áREG2,Y‰
EquåString(Y‰,Str2
sub(Str2,1,length(Str2)-3üStr2
If L„(P)ø1
Then
L„(PüE
LinReg(a+bx) áREG1,áREG2,Y‰
EquåString(Y‰,Str3
Str0+"{"+Str2+":"+sub(Str3,3,length(Str3)-3)+"}üStr0
Else
Str0+Str2üStr0
End
If L…(P)ø1+à
Then
real(L…(PüE
LinReg(ax+b)áREG1,áREG2,Y‰
EquåString(Y‰,Str2
sub(Str2,1,length(Str2)-3üStr2
If 1øimag(L…(P
Then
imag(L…(PüE
LinReg(ax+b)áREG1,áREG2,Y‰
EquåString(Y‰,Str3
"{"+Str2+":"+sub(Str3,1,length(Str3)-3üStr2
End
Str0+"ð("+Str2+")üStr0
End

If L†(P)ø1+à
Then
L†(PüE
LinReg(ax+b)áREG1,áREG2,Y‰
EquåString(Y‰,Str2
Str0+"Ýð("+sub(Str2,1,length(Str2)-3)+")üStr0
End
If real(Lƒ(P)) or imag(Lƒ(P
Then
real(Lƒ(PüK
imag(Lƒ(PüL
For(M,1,5
iPart(û2fPart(Ký^(ú12+2M)))-iPart(û2fPart(Lý^(ú12+2MüN
If N
Then
sub("ÄëàXY",M,1üStr8
N/6üN
If N>0
Then
iPart(NüQ
6fPart(NüR
If Q
Str0+"Ò"+Str8üStr0
If Q=2
Str0+"ÜüStr0
If Q=3
Str0+"ÝüStr0
If Qù4
Str0+"^"+sub("123456789",Q,1üStr0
If R=1
Str0+"Òð(Ýð("+Str8+"))üStr0
If R=2
Str0+"ÒÝð("+Str8+")üStr0
If R=3
Str0+"Òð("+Str8+")üStr0
If R=4
Str0+"ÒÝð("+Str8+")ÜüStr0
If R=5
Str0+"ÒÝð("+Str8+")ð("+Str8+")üStr0
Else
abs(NüN
iPart(NüQ
6fPart(NüR
If Q=1
Str0+"Ò"+Str8+"ñüStr0
If Qù2
Str0+"Ò"+Str8+"^ú"+sub("123456789",Q,1üStr0
If R=1
Str0+"Òð(Ýð("+Str8+"))ñüStr0
If R=2
Str0+"ÒÝð("+Str8+")ñüStr0
If R=3
Str0+"Òð("+Str8+")ñüStr0
If R=4
Str0+"ÒÝð("+Str8+")^ú2üStr0
If R=5
Str0+"ÒÝð("+Str8+")ñÒð("+Str8+")ñüStr0
End
End
End
End


End





If L(P)=2
Then
Str0+sub("+-*/^ñÜÝ",L‚(P),1üStr0
End

If L(P)=3
Then
If L‚(P)=1
Then
Str0+"(üStr0
Else
Str0+")üStr0
End
End

If L(P)=4
Then
Str0+sub("cos(sin(tan(cosñ(sinñ(tanñ(ln(log(ý^(ë^(ð(Ýð(",L‚(P),1üStr0
End

End


Programme ThétaDIV
If L(A-1)ø1 or L(A+1)ø1
Return

If Aø2
Then
If L(A-2)=2 and L‚(A-2)ù4
Return
End

If A+1øD
Then
If L‚(A+2)>4
Return
End

3üL‚(A

L‚(A+1üV
L„(A+1üL‚(A+1
VüL„(A+1

imag(L…(A+1))+àreal(L…(A+1üL…(A+1
imag(L†(A+1))+àreal(L†(A+1üL†(A+1
real(Lƒ(A+1))à+imag(Lƒ(A+1üLƒ(A+1

A-2üA


Programme ThétaFACTP
{1üáFACT
1üX
While not(fPart(.5W
2üáFACT(X
X+1üX
.5WüW
End

1üD
While D÷ð(W)+1
D+2üD
While not(fPart(round(DñW,5
DüáFACT(X
X+1üX
round(DñW,0üW
End
End
If W-1
WüáFACT(X


Programme ThétaINV
Pause "ÁINV
If L(A-1)=1
Then
A-1üB

real(Lƒ(B))à+imag(Lƒ(BüLƒ(B
real(L…(B))à+imag(L…(BüL…(B
real(L†(B))à+imag(L†(BüL†(B

L‚(BüC
L„(BüL‚(B
CüL„(B

1üÁ
prgmÁRACLIS1
A-2üA


Programme ThétaMULT
If L(A-1)ø1 or L(A+1)ø1
Return

If Aø2
Then
If L(A-2)=2 and L‚(A-2)ù4
Return
End

If A+1øD
Then
If L‚(A+2)>4
Return
End

L‚(A-1)*L‚(A+1üU
L„(A-1)*L„(A+1üV
gcd(abs(U),V)ñüR
URüL‚(A-1
VRüL„(A-1

Lƒ(A-1)+Lƒ(A+1üLƒ(A-1



real(L…(A-1))real(L…(A+1))+àimag(L…(A-1))imag(L…(A+1üL…(A-1
real(L†(A-1))real(L†(A+1))+àimag(L†(A-1))imag(L†(A+1üL†(A-1

2üÁ
prgmÁRACLIST
A-3üA


Programme ThétaOPS
dim(LüD
L‚(AüZ
If real(Z)=1 or real(Z)=2
prgmÁADDSUB

If real(Z)=3
prgmÁMULT

If real(Z)=4
prgmÁDIV

If real(Z)=6
prgmÁINV

If real(Z)=7
prgmÁCARRE

If real(Z)=8
prgmÁCUBE



If A÷0
1üA
prgmÁDISP
Pause Str0


Programme ThétaOPSPAR
Pause "OPSPAR
dim(LüD
L‚(AüZ
If real(Z)=1
prgmÁCOS
If real(Z)=2
prgmÁSIN
If real(Z)=3
prgmÁTAN


If real(Z)=11
prgmÁRAC2


If A÷0
1üA
prgmÁDISP
Pause Str0


Programme ThétaRAC2
A+1üB
If L(B)=1 and L(B+1)=3 and L‚(B+1)
Then
If L…(B)+0à=1+à and L†(B)+0à=1+à
Then
0üJ
real(Lƒ(BüK
imag(Lƒ(BüL
For(M,1,5
iPart(û2fPart(Ký^(ú12+2MüN
iPart(û2fPart(Lý^(ú12+2MüO
J+(N/2)+(O/2üJ
End

If not(J
Then
L‚(B)<0üS
abs(L‚(BüU
L„(BüV

.5Lƒ(BüLƒ(B+1
1üL(B+1

0üL…(B+1
For(F,0,1
If F
Then
VüW
1üI
1üJ
Else
UüW
1üI
1üJ
End
prgmÁFACTP
0üP
While Pødim(áFACT
P+1üP
If P+1÷dim(áFACT
Then
If áFACT(P)=áFACT(P+1
Then
P+1üP
I*áFACT(PüI
Else
J*áFACT(PüJ
End
Else
J*áFACT(PüJ
End
End

If F
Then
J*IüL„(B+1
L…(B+1)*J+àüL…(B+1
Else
IüL‚(B+1
JüL…(B+1
End
End

If S
6û4+Lƒ(B+1üLƒ(B+1

2üÁ
prgmÁRACLIST
A-2üA


Programme ThétaRACLIS1
For(B,A+Á,D
L(BüL(B-1
L‚(BüL‚(B-1
Lƒ(BüLƒ(B-1
L„(BüL„(B-1
L…(BüL…(B-1
L†(BüL†(B-1
End
D-ÁüD
Düdim(L
Düdim(L‚
Düdim(Lƒ
Düdim(L„
Düdim(L…
Düdim(L†


Programme ThétaRACLIST
For(B,A+Á,D
L(BüL(B-Á
L‚(BüL‚(B-Á
Lƒ(BüLƒ(B-Á
L„(BüL„(B-Á
L…(BüL…(B-Á
L†(BüL†(B-Á
End
D-ÁüD
Düdim(L
Düdim(L‚
Düdim(Lƒ
Düdim(L„
Düdim(L…
Düdim(L†


Programm ThétaSIN
A+1üB
If L(B)=1 and L(B+1)=3 and L‚(B+1)=ú1
Then
If L…(B)=1+à and L†(B)=1+à and (Lƒ(B)+0à=6û8+0à or L‚(B)=0
Then
L‚(B)/L„(BüC
2fPart(.5CüC
C+2(C÷0)üC
B+1üB

1üK

If C=0 or C=1
Then
1üL(B
0üL‚(B
0üLƒ(B
0üK
End

If C=1/6 or 5/6
Then
1üL(B
1üL‚(B
0üLƒ(B
2üL„(B
0üK
End

If C=1/4 or C=3/4
Then
1üL(B
0üK
1üL‚(B
0üLƒ(B
2üL„(B
2+àüL…(B
End

If C=1/3 or C=2/3
Then
1üL(B
1üL‚(B
0üLƒ(B
2üL„(B
3+àüL…(B
0üK
End

If C=1/2
Then
1üL(B
1üL‚(B
0üLƒ(B
0üK
End

If C=1+1/6 or C=1+5/6
Then
1üL(B
ú1üL‚(B
0üLƒ(B
2üL„(B
0üK
End

If C=5/4 or C=7/4
Then
1üL(B
ú1üL‚(B
0üLƒ(B
2üL„(B
2+àüL…(B
0üK
End

If C=4/3 or C=5/3
Then
1üL(B
ú1üL‚(B
0üLƒ(B
2üL„(B
3+àüL…(B
0üK
End

If C=3/2
Then
1üL(B
ú1üL‚(B
0üLƒ(B
0üK
End



If not(K
Then
2üÁ
prgmÁRACLIST
A-2üA


Programme ThétaTAN
A+1üB
If L(B)=1 and L(B+1)=3 and L‚(B+1)=ú1
Then
If L…(B)=1+à and L†(B)=1+à and (Lƒ(B)+0à=6û8+0à or L‚(B)=0
Then
L‚(B)/L„(BüC
C-int(C)üC
B+1üB

1üK

If C=0
Then
1üL(B
0üL‚(B
0üLƒ(B
0üK
End

If C=1/6
Then
1üL(B
1üL‚(B
0üLƒ(B
3+àüL…(B
0üK
End

If C=1/4
Then
1üL(B
1üL‚(B
0üLƒ(B
0üK
End

If C=1/3
Then
1üL(B
1üL‚(B
0üLƒ(B
3+àüL…(B
0üK
End

If C=2/3
Then
1üL(B
ú1üL‚(B
0üLƒ(B
3+àüL…(B
0üK
End

If C=3/4
Then
1üL(B
ú1üL‚(B
0üLƒ(B
0üK
End

If C=5/6
Then
1üL(B
ú1üL‚(B
0üLƒ(B
3üL„(B
3+àüL…(B
0üK
End


If not(K
Then
2üÁ
prgmÁRACLIST
A-2üA





Sandro

PS : je m'occupe demain des carractères spéciaux.

9

Bien.

10

mad Le remplacement automatique me fait tout à tort et à travers mad et les éditeurs de programmes ne proposent que la recherche, pas le remplacement. Don à moi que quelcun ne me signale qu'il veur regarder en détail le code, je le laisse comme ça (il y a toujours les liens de téléchargement).

Par contre si quelcun a envie d'étudier vraiment mon code, alors qu'il me préienne et je m'occupe de changer tous les carractères spéciaux.

Sandro (désolé)

11

Tu devrais essayer avec ça : http://tiforge.info/ti_editor/index.php

12

Merci du conseil, mais en cherchant, j'ai trouvé encore plus pratique : http://www.cemetech.net/projects/basicelite/sourcecoder2.php

Sinon, cotés nouveautées :
-j'ai réussit à faire la supression des parrenthèses inutiles (parrentèse nombre parenthèse)
-supréssion des parrenthèses quand elles sont précédées avec les opérations + et -
-correction d'un bug sur les additions/soustraction : avant pi-3-2 donnait pi-1 car la TI ne pouvait pas calculer pi-1
-non affichage de l'expression quand elle n'a pas changée (avant à chaque opération, même non executable (ex : pi+2), la TI recréait la chaîne (ce qui prend au moins 3 fois plus de temps qu'un simple calcul) et l'affichait même quand ça ne servait à rien).

Sandro

13

Ca serait bien si tu pouvais mettre tes archives sur le site du zcontest...
Sinon bah on prendra celles qui sont dans ./12

Bonne chance smile

14

non, je m'en ocupe : je suis juste encore en train de terminer les bêtes optimisation style L1(A)=0 devient non(L1(A

Sandro