0 Members and 2 Guests are viewing this topic.
ClrHome1->A1->BRepeat C=45Output(B,A,"*")Repeat Cgetkey->CEndOutput(B,A," ")max(min(A-(C=24)+(C=26),16),1)->Amax(min(B-(C=25)+(C=34),8),1)->BEnd
ClrHome1→AAns→BRepeat C=45Output(B,A,"*")Repeat AnsgetKey→CEndOutput(B,A," ")max(min(A-(Ans=24)+(Ans=26),16),1)→Amax(min(B-(C=25)+(C=34),8),1)→BEnd
You can replace variables with Ans in a few places.
You can also remove some of the closing parentheses but that won't affect speed at all, sadly.
ClrHome1→AAns→BRepeat C=45Output(B,A,"*Repeat AnsgetKey→CEndOutput(B,A," max(1,min(16,A-(Ans=24)+(Ans=26→Amax(1,min(8,B-(C=25)+(C=34→BEnd
ClrHomeDelVarC1→AAns→BRepeat Ans=45Output(B,A," max(1,min(16,A-(Ans=24)+(Ans=26→Amax(1,min(8,B-(C=25)+(C=34→BOutput(B,A,"*Repeat AnsgetKey→CEndEnd
ClrHome{1,1,0Repeat 45=Ans(3Output(Ans(1),Ans(2),"*Repeat Ans(3{Ans(1),Ans(2),getKeyEndOutput(Ans(1),Ans(2)," {max(1,min(16,Ans(1)-(Ans(3)=24)+(Ans(3)=26))),max(1,min(8,Ans(2)-(Ans(3)=25)+(Ans(3)=34))),Ans(3End
um, why is there a DelVar C, you don't need that.
But that requires a DelVar of C in case C somehow had a value of 26 or 34...
Repeat executes the inner body at least once, because it checks whether its condition is true after running each iteration of the body. While doesn't make this guarantee...
Quote from: Sorunome on July 24, 2013, 05:26:34 pmum, why is there a DelVar C, you don't need that.Quote from: dinosteven on July 24, 2013, 05:25:30 pmBut that requires a DelVar of C in case C somehow had a value of 26 or 34... If C=26 or C=34 before launching the program, then it'll start off in the wrong place, having already moved. lol, doesn't really matter, but just in case.
Lbl 1<code code code>If K≠45Goto 1
Lbl 1If K=45Then<code code code>Goto 1End
Quote from: dinosteven on July 24, 2013, 05:50:10 pmQuote from: Sorunome on July 24, 2013, 05:26:34 pmum, why is there a DelVar C, you don't need that.Quote from: dinosteven on July 24, 2013, 05:25:30 pmBut that requires a DelVar of C in case C somehow had a value of 26 or 34... If C=26 or C=34 before launching the program, then it'll start off in the wrong place, having already moved. lol, doesn't really matter, but just in case.But in TI-Basic a loop is alwys entered at least once (I thought), so even if C is 45 in the beginning it'll enter the loop and'll be overwritten by getKey->CAlso, just tested it and i'm right, it enteres the repeat loop once in the beginning