Code:

DelVar |LMDelVar |LL
5->dim(|LM:5->dim(|LL::0->L
"RGUWB->Str1
Lbl M
ClrHome
max(0,L->L
max(0,|LM->|LM
sum(|LM->T
If T!=0:Then
   For(X,1,5
      round(L(|LM(X)/T),0->|LL(X
   End
End
Output(1,1,"MTG LAND CALCULATOR
Output(2,2,"LANDS: "+eval(L
For(X,1,5
   Output(X+2,2,sub(Str1,X,1)+": "+eval(|LM(X
   Output(X+2,20,sub(Str1,X,1)+": "+eval(|LL(X
End
Output(8,2,"QUIT
2->A
Repeat K=105
   Output(A,1,">
Repeat Ans:getKey:End
   Ans->K
   Output(A,1,"
   A+(Ans=34)(A<8)-(Ans=25)(A>2->A
End
If A=8:Goto Q
ClrHome
A
If A=2
Input "LANDS: ",L
If A>2:Then
   Input sub(Str1,A-2,1)+": ",M
   M->|LM(A-2
End
Goto M
Lbl Q:ClrHome:Stop
Looks pretty good to me
Some excessive byte optimization:

Code:

DelVar |LMDelVar |LL
DelVar L5->dim(|LM:5->dim(|LL
"RGUWB->Str1
Lbl M
ClrHome
max(0,L->L
max(0,|LM->|LM
sum(|LM->T
If not(Ans:Then
   For(X,1,5
      T^^-1|LL(|LM(X
      round(Ans,0->|LL(X
   End
End
Output(1,1,"MTG LAND CALCULATOR
Output(2,2,"LANDS: "+toString(L
For(X,1,5
   sub(Str1,X,1
   Output(X+2,2,Ans+": "+toString(|LM(X
   Output(X+2,20,Ans+": "+toString(|LL(X
End
Output(8,2,"QUIT
2->A
Repeat K=105
   Output(A,1,">
Repeat Ans:getKey:End
   Ans->K
   Output(A,1,"
   A+(Ans=34)(A<8)-(Ans=25)(A>2->A
End
If A=8:Goto Q
ClrHome
A
If A=2
Input "LANDS: ",L
If A>2:Then
   Input sub(Str1,A-2,1)+": ",M
   M->|LM(A-2
End
Goto M
Lbl Q:ClrHome
  
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

 

Advertisement