## TI calculator simulation

Instructions

3 modes :
- use it as a normal TI calculator :) with buttons

OR
(caution -> "suppr" is delete / "backspace" is "annul") / "_" for negatives nubers )

OR
COMMANDES (not useful -> done for debugging ;) )
(this mode is done for me, but if you feel like using it tou can ^^)
- enter commandes in the text box : it presses the buttons for you ;)
example : "(2+3)/5|sto|A|enter|(A+3)/5|sto|A|enter|(A+3)/5|sto|A|enter|(A+3)/5|sto|A|enter|"

list the of commandes :

-> constants :
|#pi| example : 2|#pi|R
|#e| example : |#e|^X

oppreators :
+ example : 10+12
- example : 12-6 <- CAUTION
* example : 8*4
/ example : 44/2
_ example : _5 <- CAUTION

compartors :
= example : A=.5+.5
|!=| example : A|!=|1
> example : A>2.5
|>=| example : A|>=|5
< example : A<2.5
|<=| example : A|<=|5
|¤5_and| example : A|>=|0|¤5_and|A<10
|¤4_or| example : A=0|¤4_or|B=0
|¤5_xor| example : A=0|¤5_xor|B=0
|¤4_f_not_(n)| example : |¤4_f_not_(n)|A=0)

-> useful :
|sto| example : 145|sto|A
|^-1| example : 4.5*10|^-1|
|¤2_f_racine_carré_(n)| example : |¤2_f_racine_carré_(n)|25)
|¤3_#rep| example : |¤3_#rep|+10

-> functions :
|¤4_f_cos_(n)| example : |¤4_f_cos_(n)|45)
|¤4_f_sin_(n)| example : |¤4_f_sin_(n)|45)
|¤4_f_tan_(n)| example : |¤4_f_tan_(n)|45)
|¤7_f_acos_(n)| example : |¤7_f_acos_(n)|0.5)
|¤7_f_asin_(n)| example : |¤7_f_asin_(n)|0.5)
|¤7_f_atan_(n)| example : |¤7_f_atan_(n)|1)
|¤4_f_log_(n)| example : |¤4_f_log_(n)|1000)
|¤3_f_10^x_(n)| example : |¤3_f_10^x_(n)|3)
|¤3_f_ln_(n)| example : |¤3_f_ln_(n)|2)
|¤3_f_e^x_(n)| example : |¤3_f_e^x_(n)|X)

PRGM functions :
|¤5_F1_1_1_disp| example : |¤5_F1_1_1_disp|"TEXT"
|¤4_F1_1_0_prgm| example : |¤4_F1_1_0_prgm|TEST
|¤9_F1_1_0_edit_prgm| example : |¤9_F1_1_0_edit_prgm|TEST

|¤4_STOP| example : |¤4_STOP|
|¤6_RETURN| example : |¤6_RETURN|
|¤3_END| example : |¤3_END|
|¤4_ELSE| example : |¤4_ELSE|
|¤4_THEN| example : |¤4_THEN|
|¤3_IF| example : |¤3_IF|A=1
|¤6_WHILE| example : |¤6_WHILE|A=1
|¤7_REPEAT| example : |¤7_REPEAT|A=0
|¤4_FOR(| example : |¤4_FOR(|B,1,10,1)

Notes and Credits

I made this project MYSELF. (and it's not totally finished ^^)
THANKS :
- for using and support ^^
- for telling any problem in the comment
- to @TheMatrixKid about the name re-changment ;)
- to @DadOfMrLog for his "General "to power of" block" project http://scratch.mit.edu/projects/16871883/
- to @Griffpatch for his "ASCII Key Detector" project http://scratch.mit.edu/projects/19204741/
- Texas Instruments for great calculators ^^ -> "TI-82 Stats.fr" design

Feel free to remix (caution the code is REALLY hard !!!) ;)

HISTORIC :
19/08/2014 -> added PRGM gestion (usable though command)
26/07/2014 -> a lot optimized ^^
27/06/2014 -> Got Featured, thank so much to everyone ^^
29/04/2014 -> Shared

HOW DOES IT WORK ?

It's a little bit complicated, but I'll try and do my best to explain it easily :
For the buttons : they are each a clone that was given a kind of ID just before being created. Then as it "begins as a clone", it does something different that is relative to its ID. As an example is goes to a specific place with a specific costume and "send" a specific message when it's being clicked.
Each time this "specific message" get send, the corresponding caracter gets added to a list.
When "enter" gets send it gets processed : each caracter is given a "type" and then it crates the numbers, do the fonctions, take cares of brackets and do the opperations in the right order...
And all the displays are "just" adding each carracter in an only list...
(of course there is a lot more to it but that's the idea ^^)

Shared: 28 Apr 2014 Modified: 16 Feb 2018

More projects by baptiste2b31