+ Reply to Thread
Results 1 to 5 of 5

Thread: TI BASIC Tutorial - Conditions

  1. #1
    exfyre is offline Newbie
    Join Date
    Feb 2008
    Posts
    16
    Rep Power
    16

    TI BASIC Tutorial - Conditions

    Introduction
    TI-BASIC is the built-in program language that comes with the TI-83/84+ calculators
    Optional Resources
    1. TI-83 Plus Flash Debugger -> for running programs
    2. TI Graph link -> For writing & saving programs
    -or-
    a TI-83/84 Plus calculator -> writes and runs programs


    Conditions
    Conditions are what make programming so useful. If x is true, do this, otherwise, do something else.
    In TI-BASIC, there is no boolean variable. 0 is false, anything else is true. Because of this, some advanced techniques can be implemented that can't be implemented with normal boolean variables, but I won't discuss those in this tutorial.

    Keywords to know:
    Code:
    If
    Then
    Else
    End
    And
    Or
    Xor
    Syntax:
    Code:
    If <condition>
    Then
    <True Actions>
    Else
    <False Actions>
    End
    The "Else" and "<False Actions>" can be omitted if you only want "True Actions"

    Sample:
    Code:
    :If X=0
    :Then
    :4→X
    :End
    This should help you be able to answer the previous challenge question.

    If you have already written the answer, here is the solution to the previous challenge question:
    Code:
    prgmGUESSING
    :25→X
    :Input A, "Guess Number: "
    :If A=X
    :Then
    :Disp "That's Right!"
    :Else
    :Disp "Wrong!"
    :End
    And Or and Xor
    Frankly, I don't remember what Xor does, and I've never used it in 4.5 years of programming. And and Or, on the other hand, are in almost every one of my programs.
    Use And and Or when you want to have multiple conditions.
    For example:
    Code:
    :If X<Y And X>0
    :Then
    :0→X
    :Else
    :Y-1→X
    :End
    'And' is true when all conditions are true
    'And' is false when any condition is false
    'Or' is true when any condition is true
    'Or' is false when all conditions are false


    Challenge Question Part 1:
    Change the above code so that it tells the user whether or not their guess is too high or low.

    Challenge Question Part 2:
    Change the above code for the Guessing Game so that it asks the user for the answer until they get it correct. (add on to CQ Part 1)
    Last edited by exfyre; 08-28-2009 at 06:51 PM.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Jordan Guest

    Re: TI BASIC Tutorial - Conditions

    Very cool! Do you have a cable to hook up your TI to your computer? If so, did you build it yourself? That was the cool thing to do in the nerd group at my school, so we all built our own cables.

    +rep

  4. #3
    exfyre is offline Newbie
    Join Date
    Feb 2008
    Posts
    16
    Rep Power
    16

    Re: TI BASIC Tutorial - Conditions

    Hah. I do have my own cable, but I didn't make it. I actually don't know how to make one (you should post a tut).

  5. #4
    Jordan Guest

    Re: TI BASIC Tutorial - Conditions

    I can't remember, that was 8-10 years ago, lol. There are plenty of schematics on the web though.

  6. #5
    Join Date
    Jul 2006
    Posts
    16,491
    Blog Entries
    75
    Rep Power
    143

    Re: TI BASIC Tutorial - Conditions

    Another nice one. +rep
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. TI-BASIC Tutorial - Graphics
    By exfyre in forum Tutorials
    Replies: 4
    Last Post: 08-31-2009, 05:59 PM
  2. TI-BASIC Tutorial - Loops
    By exfyre in forum Tutorials
    Replies: 2
    Last Post: 08-29-2009, 06:42 AM
  3. TI-BASIC Tutorial - Input Methods
    By exfyre in forum Tutorials
    Replies: 3
    Last Post: 08-28-2009, 03:09 PM
  4. need basic java tutorial
    By kiddies in forum Java Help
    Replies: 10
    Last Post: 08-04-2009, 04:09 AM
  5. Tutorial : Joomla! The Basic
    By takercena in forum Tutorials
    Replies: 4
    Last Post: 02-22-2008, 09:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts