0 Members and 1 Guest are viewing this topic.
Code like that both reduces the size of your code and makes it faster. Great job!
All the checks for stuff in L6 are completely necessary. (They're your status ailments.)
Never use Y variable. Some TI-OS glitches causes it to be reset to 0 from time to time. You'll run into problems later.
@ztrumpet: Not according to TI-BD, it isnt: http://tibasicdev.wikidot.com/timings#toc3
Lunch was extraordinarily hectic
:While 1:¦ "θM"+sub("0123456789",{L4}(1),1:¦ real(10,0,0:¦ {L4}(2→X:¦ prgmXTEMP000:¦ real(10,1,0:¦ Output(1,1,Str1:¦ Output({L4}(9),{L4}(8),"π:¦ {L4}(9→Y:{L4}(8→X:¦ Repeat X=17 or Y=9 or not(XY:¦ ¦ {0 //This is unnessecary, as a Repeat loop is a post-test loop.:¦ ¦ Repeat sum(Ans //change this to sum(Ans={24,25,26,34,21,15:¦ ¦ ¦ getKey // add →θ:¦ ¦ ¦ Ans={24,25,26,34,21,15 //get rid of this:¦ ¦ End:¦ ¦ sum(Ans{24,25,26,34,21,15→θ //Get rid of this:¦ ¦ If θ=15:¦ ¦ prgmTM:¦ ¦ If θ=21:¦ ¦ Then:¦ ¦ ¦ "θM:¦ ¦ ¦ real(10,0,0:¦ ¦ ¦ prgmXTEMP000:¦ ¦ ¦ real(10,1,0:¦ ¦ ¦ If 2={L4}(4:¦ ¦ ¦ real(5,0,35:¦ ¦ ¦ If {L6}(1:¦ ¦ ¦ real(5,0,2:¦ ¦ ¦ Output(1,1,Str1:¦ ¦ End:¦ ¦ Y→T:¦ ¦ X→U:¦ ¦ Y+(θ=34)-(θ=25→Y:¦ ¦ X+(θ=26)-(θ=24→X:¦ ¦ If X≠17 and Y≠9 and XY //You could move this to the begining of the loop (before the getKey to save speed):¦ ¦ Then:¦ ¦ ¦ sub(Str1,16(Y-1)+X,1:¦ ¦ ¦ If Ans=" " or Ans="/" or Ans="-" or Ans="=" or Ans="ñ:¦ ¦ ¦ Then:¦ ¦ ¦ ¦ If Ans="ñ:¦ ¦ ¦ ¦ Then:¦ ¦ ¦ ¦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