Announcement

Collapse
No announcement yet.

Calculator Programming (TI-BASIC)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Calculator Programming (TI-BASIC)

    I've been playing around with TI-BASIC programming in the last couple of [boring] days at school. I recently created a nice little quadratic formula application for my TI-84+ graphing calculator. It comes in handy quite often in geometry class.

    I took a week-long class at the University of Washington to learn the basics of C++ programming, and that has definitely helped in picking up TI-BASIC. For example, terms like for and while loops are familiar, as well as the layout of an application. Of course, TI-BASIC is much more, you guessed it, basic. But hey, what else are you going to do in school?

    So, what kind of applications have you guys created? What apps do you use on your calculators?
    Last edited by UniTyler; 2007-09-08, 10:21 PM.

  • #2
    Wow.

    Comment


    • #3
      Back when I was taking engineering classes I programmed in boring things like numerical approximation methods or equation solving methods. Just things that would possibly be needed for questions on midterms or finals. For homework questions I usually crunched the equations by hand or used a proper computer.

      That was on HP calculators. Never used a TI.
      john_childs (att) hotmail (dott) com
      Team Never Wash Your Muni
      My Gallery :: Unicycling Bookmark List :: World Clock

      Comment


      • #4
        I never used a TI for school, but I used a friend's TI for a while and programmed blackjack and keno games into it. Its limited display stifled my creativity.

        My HP graphing calc, on the other hand... I programmed Pong, Pac Man and Pole Position into the thing in one semester of high school. Kinda goes to show how boring my teachers were...

        Nowadays people are downloading modified Nintendo ROMs onto their super-duper-solve anything-calculator. Some of these models do way too much work for the student, leaving them dumber than dirt. Seriously, I took upper division physics with one kid who couldn't do a simple integral without whipping out his HP.

        Do yourself a favor and dump the whiz-bang doohickey. Grab a $5 scientific calculator that does trig and exponentials and that should get you all the way through your PhD if you work hard enough... and you'll be smarter for all the work.

        Or, as Harper will recommend, grab a slide rule. It's just damn cool.
        "The trouble with the world is that the stupid are cocksure and the intelligent are full of doubt." - Bertrand Russell

        Comment


        • #5
          Originally posted by maestro8
          I never used a TI for school, but I used a friend's TI for a while and programmed blackjack and keno games into it. Its limited display stifled my creativity.

          My HP graphing calc, on the other hand... I programmed Pong, Pac Man and Pole Position into the thing in one semester of high school. Kinda goes to show how boring my teachers were...

          Nowadays people are downloading modified Nintendo ROMs onto their super-duper-solve anything-calculator. Some of these models do way too much work for the student, leaving them dumber than dirt. Seriously, I took upper division physics with one kid who couldn't do a simple integral without whipping out his HP.

          Do yourself a favor and dump the whiz-bang doohickey. Grab a $5 scientific calculator that does trig and exponentials and that should get you all the way through your PhD if you work hard enough... and you'll be smarter for all the work.

          Or, as Harper will recommend, grab a slide rule. It's just damn cool.
          Haha yeah. That is why I learn everything without it then use it just too speed things up. I probably could be in a higher math class if all I did was punch everything into a calculator. That takes just about no brains. It basically turns into memorizing an equation and substituting in everything.

          Comment


          • #6
            I've got Casio graphic calculator. I made quite a few probgrammes with it. I think the language is CBasic, but I'm not too sure. My programmes were different ones, some small bits to trick people into thinking my calculator gave out 5 when asked to calculate 2+2, there was a programme that said "Hacking the matrix" and run a line of zeros and ones at the top of the screen. If you pressed a button it would stop and a sign would appear saying "Do not disturb". I gave it to my maths teacher she looked at it for some time and said it might be dangerous for my calculator. I said "What, hacking the matrix? Very dangerous!" The whole class was laughing(or at least the ones who knew the programme).

            I also made a small game called Adventures of the Eight. I never finished it, because the refresh rate got too slow as I added to the game, so I just gave up. I made some other programmes, but can't think of any right now.

            A friend of mine made this whole project that allowed him to render different fractals with all sorts of settings, resolutions, etc on his calculator. He even added colour later. The only problem, the calculator is slow and it would take ages to render one fractal. But it was cool.

            He and I also drew on the calculator using the memory feature and geometrical shapes. Ahh, the boring school times...
            Did you know that lighter flame smells like burnt nose hair?
            Entropy isn't what it used to be.

            Comment


            • #7
              Here's a fun programming concept to work on. We'll play with the factorial function.

              Your algebra book should have a definition of how to calculate a factorial.

              The factorial is the function on your calculator with the !

              There is a basic definition here (only pay attention to the top half of the page).

              The important part is that 0! is defined to be equal to 1

              0! = 1
              1! = 1
              2! = 2 * 1
              3! = 3 * 2 * 1
              4! = 4 * 3 * 2 * 1

              You get the idea. The numbers get really big really quick.

              So write a program that uses a loop to calculate the factorial. How big can you go before the calculator overflows and the result is no longer exact?
              john_childs (att) hotmail (dott) com
              Team Never Wash Your Muni
              My Gallery :: Unicycling Bookmark List :: World Clock

              Comment


              • #8
                If I were doing it in C++, I'd just use for.

                answer=1;
                for(a=whatever;a>0;a--)
                {
                answer = answer*a;
                }

                There's probably a mistake or two in there, but the principle is simple. I'd do the same on the calculator, it'd just be a bit more cumbersome to type out.
                Did you know that lighter flame smells like burnt nose hair?
                Entropy isn't what it used to be.

                Comment


                • #9
                  Originally posted by maestro8
                  Or, as Harper will recommend, grab a slide rule. It's just damn cool.
                  I have one. They are.

                  (in best Guiness commercial impersonation) Multiply numbers by adding them? Brilliant!
                  Last edited by onelesscar; 2007-09-09, 06:35 PM.
                  Now a self-employed world traveler.

                  Comment


                  • #10
                    I'm proud of you for starting a nerd corner, Tyler. The quadratic equation is useful for many applications. Deriving the quadratic formula is very instructive as well.

                    I used to road test my programmable calculators by writing either a rectangular or trapezoidal integrating routine and make it solve for Pi. I used to make it calculate 200,000 steps or so and have it run for four or five days. I think with that resolution I could get solutions that were only good to a part in 100,000. I did this first for an SR-56, one of TI's first programmables and the first to be marketed for under $100. Then for an HP-21 and finally an HP-29C. This was in the 70's and I have since abandoned all programmable calculators. The sentence is, "slide rules."
                    -Greg Harper

                    Nipples...do you ever have enough?

                    Change is good. Bills are better.

                    Comment


                    • #11
                      Originally posted by harper
                      I'm proud of you for starting a nerd corner, Tyler.
                      I guess if this thread is for all nerdy topics, I may as well mention that I bought a 160 gig HDD (upgraded from 30 gig!) for my laptop, and am now dual booting Win XP and Ubuntu Linux (7.04 Feisty Fawn) with it. w00t.
                      Last edited by UniTyler; 2007-09-10, 01:20 AM.

                      Comment


                      • #12
                        Originally posted by ivan
                        If I were doing it in C++, I'd just use for.

                        answer=1;
                        for(a=whatever;a>0;a--)
                        {
                        answer = answer*a;
                        }

                        There's probably a mistake or two in there, but the principle is simple. I'd do the same on the calculator, it'd just be a bit more cumbersome to type out.
                        Yep, that makes sense.

                        Comment


                        • #13
                          OK, I'll make my "triple post" a worthwhile one. I wrote a "trick" app similar to what Ivan described.

                          Here's the code. It's pretty self explanatory (as most BASIC is):

                          : Disp "Enter two numbers to add."
                          : Prompt A,B
                          : ((A+B)+randInt(1,9))


                          Although, if I showed this app to somebody they would probably just think I was a crap programmer and not be "tricked."
                          Last edited by UniTyler; 2007-09-10, 02:31 AM.

                          Comment


                          • #14
                            Originally posted by ivan
                            If I were doing it in C++, I'd just use for.
                            Yes, but the next lesson is to do it recursively.

                            The factorial has a straightforward recursive definition:

                            base case: 0! = 1
                            recursive case: n! = n*(n-1)! for n > 0

                            Now write a factorial function in C that calculates the factorial using recursion. No loops allowed.

                            I did a quick look at a TI-BASIC wiki and recursive functions in TI-BASIC are also possible but require some programming tricks. We'll jump away from TI-BASIC for this recursion lesson since TI-BASIC will just complicate things. (HP calculators can do recursion without funky tricks)
                            john_childs (att) hotmail (dott) com
                            Team Never Wash Your Muni
                            My Gallery :: Unicycling Bookmark List :: World Clock

                            Comment


                            • #15
                              Recursion sucks. It eats up memory and processor time. And the way you're teaching us just goes on to prove that you're a unicyclist. Very unconventional. The traditional text-book way would be to solve your problem using recursion, then knock it because it's too slow and solve it again with loops to make everyone happy and impressed with how much optimising your algorythms helps.

                              Okay, a programme in C. Let's see...

                              Code:
                              int fractal(int number)
                              {
                                 if(number>0)
                                    {
                                        return (fractal(number-1)*number);
                                     }
                                   return 1;
                              }
                              I think this is wrong and could be made easier, but it's half six in the morning, I'm sore from working the whole weekend and I want my breakfast. Plus, recursion sucks anyway. But the idea is there...

                              Edit: I'll just put it in code, because the forum messes up the formatting.
                              Last edited by ivan; 2007-09-10, 03:32 AM.
                              Did you know that lighter flame smells like burnt nose hair?
                              Entropy isn't what it used to be.

                              Comment

                              Working...
                              X