Unicyclist Community

home gallery forums webmail links map donate
Go Back   Unicyclist Community > Non-unicycling Discussion > Just Conversation & Introduce Yourself

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 2007-09-08, 10:13 PM   #1
UniTyler
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.
UniTyler is offline   Reply With Quote
Old 2007-09-09, 01:21 AM   #2
wickedbob
Registered User
 
wickedbob's Avatar
 
Join Date: Feb 2007
Posts: 4,063
Wow.
wickedbob is offline   Reply With Quote
Old 2007-09-09, 01:39 AM   #3
john_childs
Guinness Mojo
 
john_childs's Avatar
 
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
john_childs is offline   Reply With Quote
Old 2007-09-09, 02:06 AM   #4
maestro8
is what it is
 
maestro8's Avatar
 
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
maestro8 is offline   Reply With Quote
Old 2007-09-09, 02:20 AM   #5
wickedbob
Registered User
 
wickedbob's Avatar
 
Join Date: Feb 2007
Posts: 4,063
Quote:
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.
wickedbob is offline   Reply With Quote
Old 2007-09-09, 03:54 AM   #6
ivan
Non-Danish Girl
 
ivan's Avatar
 
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.
ivan is offline   Reply With Quote
Old 2007-09-09, 08:33 AM   #7
john_childs
Guinness Mojo
 
john_childs's Avatar
 
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
john_childs is offline   Reply With Quote
Old 2007-09-09, 10:27 AM   #8
ivan
Non-Danish Girl
 
ivan's Avatar
 
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.
ivan is offline   Reply With Quote
Old 2007-09-09, 06:34 PM   #9
onelesscar
I get places on 75% fewer wheels
 
onelesscar's Avatar
 
Join Date: Nov 2005
Location: Irvine / Modesto
Age: 25
Posts: 1,129
Quote:
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!
__________________
Catching the coker fever.

Last edited by onelesscar; 2007-09-09 at 06:35 PM.
onelesscar is offline   Reply With Quote
Old 2007-09-09, 07:15 PM   #10
harper
768 - It's in your DNA
 
harper's Avatar
 
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
harper is offline   Reply With Quote
Old 2007-09-10, 01:19 AM   #11
UniTyler
Registered User
 
Join Date: Apr 2004
Posts: 2,931
Quote:
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 at 01:20 AM.
UniTyler is offline   Reply With Quote
Old 2007-09-10, 01:20 AM   #12
UniTyler
Registered User
 
Join Date: Apr 2004
Posts: 2,931
Quote:
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.
UniTyler is offline   Reply With Quote
Old 2007-09-10, 02:31 AM   #13
UniTyler
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.
UniTyler is offline   Reply With Quote
Old 2007-09-10, 02:54 AM   #14
john_childs
Guinness Mojo
 
john_childs's Avatar
 
Join Date: Oct 2001
Location: Portland, Oregon USA
Posts: 12,420
Quote:
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
john_childs is offline   Reply With Quote
Old 2007-09-10, 03:30 AM   #15
ivan
Non-Danish Girl
 
ivan's Avatar
 
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;
}
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.
__________________
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.
ivan is offline   Reply With Quote
Reply

Tags
calculator, programming, tibasic


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT. The time now is 12:08 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright © 2001-2005 Gilby
Page generated in 0.12289 seconds with 10 queries