This is my current TGUI routine (Text GUI). I tried to make it as small and fast as possible, but are there any more optimizations I could do?

That weird small 'E' == the 2nd-Comma 'E' (whatever the heck it's called).

Menu (finally made it display more than eight items now - yay!)
Returns selected item in Ans and X.

Numerical Input
<lower bound> -> U
<upper bound> -> V
"1<default number>
Returns selected number in Ans and X.

Text Evaluation Wrapper
Return entered text (or evaluation) in Str7.

BASIC Code wrote:
:If Ans=1
:Goto 1
:If Ans=2
:Goto 2
:DelVar W{0→A
:Repeat max(PMT={21,22
:If nMin≥length(Str7
:DelVar W0→nMin
:If not(max(nMin=∟A
:Repeat θMin>8 or nMin≥length(Str7
:Repeat X<1 or X>θMin or max(PMT={21,22,105
:Repeat Ans
:If Ans≠π and Ans≤θMin
:If X≥1:Then
:If W:Then
:DelVar XW-1→W
:DelVar Str7Ans-1+8(W-1→X
:If PMT=22:‾1→X
:Lbl 1
:Repeat max(Ans={21,105,22
:Repeat Ans
:DelVar Str7PMT→X
:Lbl 2
:Input Str7
:If X:Then
Generated by SourceCoder, © 2005 Cemetech
Insanity wrote:
That weird small 'E' == the 2<sup>nd</sup>-Comma 'E' (whatever the heck it's called).

Exponent (for scientific notation).

BASIC Code wrote:
:If Ans=1
:Goto 1
:If Ans=2
:Goto 2

Space optimization: Switch lines A and B and remove line C, and take out the " →W " from line A. This puts that value in Ans without using the W variable, which only gets deleted later. Saves 4 bytes.
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum