![]() |
|
|
#1 |
|
Registered User
Join Date: Apr 2004
Posts: 2,931
|
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 at 10:21 PM. |
|
|
|
|
|
#2 |
|
Registered User
Join Date: Feb 2007
Posts: 4,063
|
Wow.
|
|
|
|
|
|
#3 |
|
Guinness Mojo
Join Date: Oct 2001
Location: Portland, Oregon USA
Posts: 12,420
|
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 |
|
|
|
|
|
#4 |
|
is what it is
Join Date: Sep 2004
Location: hella Nor Cal
Age: 35
Posts: 6,555
|
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 |
|
|
|
|
|
#5 | |
|
Registered User
Join Date: Feb 2007
Posts: 4,063
|
Quote:
|
|
|
|
|
|
|
#6 |
|
Non-Danish Girl
Join Date: Jul 2006
Location: Prague, Czech Republic
Age: 25
Posts: 7,210
|
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.
|
|
|
|
|
|
#7 |
|
Guinness Mojo
Join Date: Oct 2001
Location: Portland, Oregon USA
Posts: 12,420
|
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 |
|
|
|
|
|
#8 |
|
Non-Danish Girl
Join Date: Jul 2006
Location: Prague, Czech Republic
Age: 25
Posts: 7,210
|
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.
|
|
|
|
|
|
#9 | |
|
I get places on 75% fewer wheels
Join Date: Nov 2005
Location: Irvine / Modesto
Age: 25
Posts: 1,129
|
Quote:
(in best Guiness commercial impersonation) Multiply numbers by adding them? Brilliant!
__________________
Catching the coker fever. Last edited by onelesscar; 2007-09-09 at 06:35 PM. |
|
|
|
|
|
|
#10 |
|
768 - It's in your DNA
Join Date: Sep 2001
Age: 60
Posts: 8,556
|
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 Destroying the climate by shutting down nuclear power plants, one by one, since 1979. JC is the only main man. There can be no other. "A fool on a unicycle is redundant" - J.D. Miller |
|
|
|
|
|
#11 | |
|
Registered User
Join Date: Apr 2004
Posts: 2,931
|
Quote:
Last edited by UniTyler; 2007-09-10 at 01:20 AM. |
|
|
|
|
|
|
#12 | |
|
Registered User
Join Date: Apr 2004
Posts: 2,931
|
Quote:
|
|
|
|
|
|
|
#13 |
|
Registered User
Join Date: Apr 2004
Posts: 2,931
|
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 at 02:31 AM. |
|
|
|
|
|
#14 | |
|
Guinness Mojo
Join Date: Oct 2001
Location: Portland, Oregon USA
Posts: 12,420
|
Quote:
![]() 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 |
|
|
|
|
|
|
#15 |
|
Non-Danish Girl
Join Date: Jul 2006
Location: Prague, Czech Republic
Age: 25
Posts: 7,210
|
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;
}
Edit: I'll just put it in code, because the forum messes up the formatting.
__________________
Did you know that lighter flame smells like burnt nose hair? Entropy isn't what it used to be.
Last edited by ivan; 2007-09-10 at 03:32 AM. |
|
|
|
![]() |
| Tags |
| calculator, programming, tibasic |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| eccentric wheel spoke calculator | joemarshall | General Unicycling Discussions | 3 | 2003-05-14 07:08 PM |
| Spoke Calculator | Roger Davies | General Unicycling Discussions | 1 | 2002-02-05 04:22 PM |