1

Par curiosité, peut-on optimiser ça en une ligne ?

tbl_rtt[int_rtr++]=1;
tbl_rtt[int_rtr]=1;
avatar
All right. Keep doing whatever it is you think you're doing.
------------------------------------------
Besoin d'aide sur le site ? Essayez par ici :)

2

Bob 64 a écrit :
Par curiosité, peut-on optimiser ça en une ligne ?

tbl_rtt[int_rtr++]=1; tbl_rtt[int_rtr]=1;

Oui.
tbl_rtt[int_rtr++]=1;tbl_rtt[int_rtr]=1; grin

3

Ct pas exactement ce à koi je m'attendais roll

Qqun a une réponse intelligente ? grin
avatar
All right. Keep doing whatever it is you think you're doing.
------------------------------------------
Besoin d'aide sur le site ? Essayez par ici :)

4

En changeant le type de données peut-être ?

5

tbl_rtt[int_rtr++]=1; tbl_rtt[int_rtr]=1; grin

Pour être sérieux : ((long *)tbl_rtt)[int_rtr++]= 0x00010001;
avatar
Un site complet sur lequel vous trouverez des programmes et des jeux pour votre calculatrice TI 89 / Titanium / 92+ / Voyage 200 : www.ti-fr.com.
Quelques idées personnelles ici.

6

J'ai même pas eu besoin de chercher, c'est génial gni.

7

Merde zdrubal a eu la même idée que moi grin
avatar
Un site complet sur lequel vous trouverez des programmes et des jeux pour votre calculatrice TI 89 / Titanium / 92+ / Voyage 200 : www.ti-fr.com.
Quelques idées personnelles ici.

8

ah oué ça affecte les 2 rangs en même temps... ok merci smile

après compilation ça prends plus, autant ou moins de place ?
avatar
All right. Keep doing whatever it is you think you're doing.
------------------------------------------
Besoin d'aide sur le site ? Essayez par ici :)

9

2 octets de plus
avatar
Un site complet sur lequel vous trouverez des programmes et des jeux pour votre calculatrice TI 89 / Titanium / 92+ / Voyage 200 : www.ti-fr.com.
Quelques idées personnelles ici.

10

ah ok c pas génial... faudra que j'essaie quand même, merci smile
avatar
All right. Keep doing whatever it is you think you're doing.
------------------------------------------
Besoin d'aide sur le site ? Essayez par ici :)

11

Arf attend remarque, peut-être pas, je me suis basé sur la première ligne !! Il se peut que ça donne un code moins gros en fait. Ca dépend des optimisations de TIGCC.
Le meilleur moyen de savoir c'est de compiler et mater le code généré.
avatar
Un site complet sur lequel vous trouverez des programmes et des jeux pour votre calculatrice TI 89 / Titanium / 92+ / Voyage 200 : www.ti-fr.com.
Quelques idées personnelles ici.

12

V voir ça tt de suite...
avatar
All right. Keep doing whatever it is you think you're doing.
------------------------------------------
Besoin d'aide sur le site ? Essayez par ici :)

13

Résultat : 7773 octets partout, il n'y a aucune différence smile
avatar
All right. Keep doing whatever it is you think you're doing.
------------------------------------------
Besoin d'aide sur le site ? Essayez par ici :)

14

C'est plus élégant wink

15

C plus "pro" c sûr... Mais ça rend la source moins compréhensible aussi...
avatar
All right. Keep doing whatever it is you think you're doing.
------------------------------------------
Besoin d'aide sur le site ? Essayez par ici :)

16

Essaies {long *plong= (long *)&tbl_rtt[int_rtr++]; *plong= 0x00010001;} confus
avatar
Un site complet sur lequel vous trouverez des programmes et des jeux pour votre calculatrice TI 89 / Titanium / 92+ / Voyage 200 : www.ti-fr.com.
Quelques idées personnelles ici.

17

4 octets de plus.

(ce qui ammene le prog à 7777 octets, beau chiffre grin)
avatar
All right. Keep doing whatever it is you think you're doing.
------------------------------------------
Besoin d'aide sur le site ? Essayez par ici :)

18

Conclusion : reste à la première implémentation wink
avatar
Un site complet sur lequel vous trouverez des programmes et des jeux pour votre calculatrice TI 89 / Titanium / 92+ / Voyage 200 : www.ti-fr.com.
Quelques idées personnelles ici.

19

vi grin

dommage 7777 c classe comme taille grin
avatar
All right. Keep doing whatever it is you think you're doing.
------------------------------------------
Besoin d'aide sur le site ? Essayez par ici :)

20

vive les écritures indigestes !
avatar
Tutorial C (TI-89/92+/v200) - Articles Développement Web (PHP, Javascript, ...)
« What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against? » - Larry Wall

21

J'ai découvert que pour ça, le C est encore mieux que le basic love
avatar
All right. Keep doing whatever it is you think you're doing.
------------------------------------------
Besoin d'aide sur le site ? Essayez par ici :)

22

oué, mais c'est au programmeur de savoir quoi utiliser...
si tu veux diffuser ton code, je connais pas gd monde qui va ne serait-ce que essayer de comprendre ça !
avatar
Tutorial C (TI-89/92+/v200) - Articles Développement Web (PHP, Javascript, ...)
« What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against? » - Larry Wall

23

Non mais g laissé l'écriture "simple", vu que l'autre n'apporte rien.

Par contre si une écriture illisible me fait gagner ne serait-ce qu'un octet, je la laisse grin
avatar
All right. Keep doing whatever it is you think you're doing.
------------------------------------------
Besoin d'aide sur le site ? Essayez par ici :)

24

arf...
essaye directement en ASM alors...
tu pourra spas optimiser plus
avatar
Tutorial C (TI-89/92+/v200) - Articles Développement Web (PHP, Javascript, ...)
« What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against? » - Larry Wall

25

ASM... oué mais c un truc grand saut j'ai l'impression sad
avatar
All right. Keep doing whatever it is you think you're doing.
------------------------------------------
Besoin d'aide sur le site ? Essayez par ici :)

26

disons que si c'est pr ton truc utilisé à partir du BASIC? l'optimisation n'est pas vraiménet nécessaire (étant donné la llenteur du BASIC)
avatar
Tutorial C (TI-89/92+/v200) - Articles Développement Web (PHP, Javascript, ...)
« What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against? » - Larry Wall

27

Quel truc ?

Sinon l'optisation du basic, au contraire... En C même sans beaucoup optimiser on peut sortir quelque chose de potable (j'ai pas dit exellent, j'ai dit potable). Même plutot bien.
Alors qu'en basic c'est même pas la peine d'y penser, un jeu ne sera pas jouable avant d'avoir été optimisé à fond, ou presque. Mais bon ça fait travailler...
avatar
All right. Keep doing whatever it is you think you're doing.
------------------------------------------
Besoin d'aide sur le site ? Essayez par ici :)

28

un truc en basic restera lent...
tandis qu'en C, il peut doubler de vitesse selon certains choix stratégiques
avatar
Tutorial C (TI-89/92+/v200) - Articles Développement Web (PHP, Javascript, ...)
« What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against? » - Larry Wall

29

Un truc en basic restera lent...
> Comparé à un truc en C, oui. Mais comparé au même "truc" non-optimisé, il est bien plus rapide. Je vois souvent ici des programmeurs en C contents d'avoir gagné une frame ou 2 par seconde.
Personnellement je reprends parfois 3 ou 4 fois un programme à zéro pour l'avoir le plus rapide possible.
avatar
All right. Keep doing whatever it is you think you're doing.
------------------------------------------
Besoin d'aide sur le site ? Essayez par ici :)

30

Il m'arrive aussi souvent de reprendre un prog de 0 pour le rendre plus rapide.
et même en C !!!
et quand je dis gagner 50% de vitesse, je ne plaisante pas
avatar
Tutorial C (TI-89/92+/v200) - Articles Développement Web (PHP, Javascript, ...)
« What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against? » - Larry Wall