Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's TI-BASIC subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. 68k Calculator Basic => TI-BASIC
Author Message
todlangweilig


Advanced Member


Joined: 14 Feb 2006
Posts: 470

Posted: 20 Oct 2006 12:46:21 am    Post subject:

how can I do the following on an 89?


Code:
t-(x=338)+(x=344)->t
t+(t=-1)-(t=22)->t

This is code to update t, when the up or down key is pressed. down increases, up decreases. It also keeps t >=0 and <=21. Only problem is it doesn't work.

So, what I have now is:

Code:
If x=338
t-1->t
If x=344
t+1->t
If t=-1
t+1->t
If t=22
t-1->t
Back to top
aforsy
the leaping penguin


Active Member


Joined: 13 Jul 2004
Posts: 653

Posted: 20 Oct 2006 02:09:26 pm    Post subject:

as far as i know, that's about as simple as you can make it on the 89.

you can use the when() function like this:
when(condition,isTrue Do: command,isFalse Do: command,isUndefined Do: command)

but i guess that's only applicable in boundary detection and similar things where you're only checking for one parameter instead of four.
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 20 Oct 2006 03:19:19 pm    Post subject:

you could use when(condition,1,0) to convert a true/false value to a 0 or 1.

Also, if this is the only way t can change, you could combine the conditions to be (x=338 and t>0) and (x=344 and t<21) respectively, and have two conditions less to check for.
Back to top
Display posts from previous:   
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
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are GMT - 5 Hours

 

Advertisement