Ti Calculator Programing

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Moderators General, Prelates

Shiral
Posts: 9
Joined: Thu Jan 10, 2008 8:13 pm UTC

Ti Calculator Programing

Postby Shiral » Tue Jan 15, 2008 1:08 am UTC

While sitting in the non-essential classes (Social studies, english, etc :D) I often find myself alot of free time after work is completed. So I turn to my trusty TI-84 Plus Silver Edition calculator and mess around with their basic. I've learned basic on the calculator in a month or so, and I'm doing some pretty advanced stuff involving matrices etc. I'm going to attempt learning assembly in a bit, but I've looked it over and it is so confusing :?


How many of you have messed around with your calculators while in class?

User avatar
Hammer
Because all of you look like nails.
Posts: 5491
Joined: Thu May 03, 2007 7:32 pm UTC
Contact:

Re: Ti Calculator Programing

Postby Hammer » Tue Jan 15, 2008 1:13 am UTC

Many people. Search is your friend. :D
"What's wrong with you mathematicians? Cake is never a problem."

User avatar
Sc4Freak
Posts: 673
Joined: Thu Jul 12, 2007 4:50 am UTC
Location: Redmond, Washington

Re: Ti Calculator Programing

Postby Sc4Freak » Tue Jan 15, 2008 4:52 am UTC

I once wrote a simple wireframe 3D renderer for my TI-89 Titanium. It supported full 3D: it could do translations, scaling and rotations in all 3 dimensions, and was fully perspective correct. It didn't support moving the camera, though, for performance's sake. It ran at a blistering 0.5fps, since it was written entirely in TI-BASIC.

I'd post a screenshot, but for some reason TI-Connect is refusing to play nice with Vista.

User avatar
b.i.o
Green is the loneliest number
Posts: 2519
Joined: Fri Jul 27, 2007 4:38 pm UTC
Location: Hong Kong

Re: Ti Calculator Programing

Postby b.i.o » Tue Jan 15, 2008 5:41 am UTC

I did a bit, although I didn't do anything too impressive. One of my better programs was one that could calculate 2D vectors and gave me a nice pretty perfectly scaled graph with all the lengths and angles. Not that 2D vectors are hard, I just got tired of doing them :P.

User avatar
kyotofeline
Posts: 3
Joined: Tue Jan 15, 2008 3:47 am UTC
Location: Los Angeles

Re: Ti Calculator Programing

Postby kyotofeline » Tue Jan 15, 2008 6:36 am UTC

I only did basic stuff, a program that calculated calculus formulas.... nothing as advanced as wireframe rendering (This on a basic TI-83)
But.... it's something to take attention away from English or Religion courses (No offense, I'm a math major ^^; )
Not to mention those cool downloadable games.... what would midterms be without DDR?

User avatar
Cosmologicon
Posts: 1806
Joined: Sat Nov 25, 2006 9:47 am UTC
Location: Cambridge MA USA
Contact:

Re: Ti Calculator Programing

Postby Cosmologicon » Tue Jan 15, 2008 6:37 am UTC

I set out to make a space-based adventure game on a TI-83 in 1997. I only managed to get as far as the intro screens plus drawing the initial map before I used up half the memory, though.

User avatar
hyperion
"I'll show ye...."
Posts: 1569
Joined: Wed Nov 29, 2006 2:16 pm UTC
Location: Perth

Re: Ti Calculator Programing

Postby hyperion » Tue Jan 15, 2008 8:01 am UTC

The most complicated thing I've ever programmed on my trusty HP39gs was a game where you had to shoot a target by setting the angle and velocity at which to shoot.
Peshmerga wrote:A blow job would probably get you a LOT of cheeseburgers.
But I digress.

aib
Posts: 9
Joined: Wed Jan 02, 2008 11:42 am UTC

Re: Ti Calculator Programing

Postby aib » Thu Jan 17, 2008 11:23 am UTC

HYPERiON wrote:The most complicated thing I've ever programmed on my trusty HP39gs was a game where you had to shoot a target by setting the angle and velocity at which to shoot.


Ahh, GORILLAS.BAS. I myself have tried writing the snake game (NIBBLES.BAS) using Ti-BASIC. It ran at 1 fps or so.

I'm afraid you have to use assembly for anything graphic-related or remotely complicated. There are some shells which make your life easier for you, but I don't know if a simple assembly editor-assembler-loader solution exists, which would allow you to write assembly on-the-fly, i.e. during class.

Good luck.

User avatar
hyperion
"I'll show ye...."
Posts: 1569
Joined: Wed Nov 29, 2006 2:16 pm UTC
Location: Perth

Re: Ti Calculator Programing

Postby hyperion » Thu Jan 17, 2008 12:35 pm UTC

Sc4Freak: sauce plz

aib wrote:
HYPERiON wrote:The most complicated thing I've ever programmed on my trusty HP39gs was a game where you had to shoot a target by setting the angle and velocity at which to shoot.


Ahh, GORILLAS.BAS. I myself have tried writing the snake game (NIBBLES.BAS) using Ti-BASIC. It ran at 1 fps or so.

Oh me yarm gorilla was the first game on my first computer <3
But my 'game' is nowhere near that cool. It was really just an experiment with projectile motion.

I'm interested in learning assembly, but it's a little scary... :/
Peshmerga wrote:A blow job would probably get you a LOT of cheeseburgers.
But I digress.

User avatar
MoD
Posts: 107
Joined: Sun Dec 30, 2007 4:55 pm UTC

Re: Ti Calculator Programing

Postby MoD » Fri Jan 18, 2008 1:33 am UTC

I've got a Casio FX-9750G Plus calculator, and it's really nice; I have basic solving algorihms for quadratics and a few specific types of other functions, and I have a prime-number checker (generator comes soon), a string system (implemented over the braindead list system that doesn't support dynamic redimensioning), and an image editor (like 1bit MS Paint, keyboard-operated). Does any one have any experience with assembly on that model of Casio calculator? I've messed around a bit, and the only way I could think of using assembly without extreme hacking would be to write a BASIC program that loads ints (interpreted as machine code, previously hand-built from opcodes and knowledge of the number system; an int is 10 bytes and includes imaginary numbers (in the 10 bytes, if I'm not mistaken).) incrementally into the stack (they also would probably need to have some kind of return-to-basic-program bytes in there, but I don't know the assembly language very well yet) via a hack that allows full access to memory.

Fun. :|
Last edited by MoD on Wed Jan 21, 2009 11:13 pm UTC, edited 1 time in total.

User avatar
b.i.o
Green is the loneliest number
Posts: 2519
Joined: Fri Jul 27, 2007 4:38 pm UTC
Location: Hong Kong

Re: Ti Calculator Programing

Postby b.i.o » Fri Jan 18, 2008 5:45 am UTC

Well, I know absolutely nothing about it, but it sounds like your calculator's dialect of Basic is more powerful and hopefully faster than that found on TI's--the main attraction of Assembly on TI's is that Basic is ridiculously slow.

User avatar
Amnesiasoft
Posts: 2573
Joined: Tue May 15, 2007 4:28 am UTC
Location: Colorado
Contact:

Re: Ti Calculator Programing

Postby Amnesiasoft » Sat Jan 19, 2008 10:02 am UTC

Silver2Falcon wrote:TI's is that Basic is ridiculously slow.

Mainly because it seems to fragment and leak memory very badly. Most BASIC games I've written run just fine for a while, then slow down until I get a memory error.

User avatar
enk
Posts: 754
Joined: Mon Sep 10, 2007 12:20 am UTC
Location: Aalborg, Denmark
Contact:

Re: Ti Calculator Programing

Postby enk » Sat Jan 19, 2008 12:54 pm UTC

MoD wrote:I've got a Casio FX-9750G Plus calculator, and it's really nice; I have basic solving algorihms for quadratics and a few specific types of other functions, and I have a prime-number checker (generator comes soon), a string system (implemented over the braindead list system that doesn't support dynamic redimensioning), and an image editor (like 1bit MS Paint, keyboard-operated). Does any one have any experience with assembly on that model of Casio calculator? I've messed around a bit, and the only way I could think of using assembly without extreme hacking would be to write a BASIC program that loads ints (interpreted as machine code, previously hand-built from opcodes and knowledge of the number system; an int is 10 bytes and includes imaginary numbers (in the 10 bytes, if I'm not mistaken).) incrementally into the stack (they also would probably need to have some kind of return-to-basic-program bytes in there, but I don't know the assembly language very well yet) via a hack that allows full access to memory.

Fun. :|


Dude... I learned to program on that snazzy beast!

Made a tankwars/gorillas game, a 2D refractive index simulator, an EA-200 (data logger) control program, a molecular mass calculator, a 3D pie chart drawer (which conveniently could be coupled with a program that told me how much time was left of the current class when I entered the time :) ), a program that converted between frequency and musical notes (octave, halftone, cents), a program that showed all the ways you could play a specific note on a guitar, plus a multitude of other stuff and the usual math programs.

It sure could use a speed boost from assembly. I don't know how to do it either, but have you tried the google? :wink:
phlip wrote:Ha HA! Recycled emacs jokes.

Wizzard1
Posts: 15
Joined: Thu Dec 13, 2007 11:15 pm UTC

Re: Ti Calculator Programing

Postby Wizzard1 » Sat Jan 19, 2008 4:08 pm UTC

My microLife is an acheivement :-D
For the TI-89, the entire code runs VERY quickly, and fits onto one screen!!
I get an ant moving about as fast as I can spot it, and the entire program is only 137 bytes!

The -> represents STO command.

:Prgm:Local x,y,L
:38->x:84->y:{1,0,-1,0)->L
:ClrDraw:While true
:when(pxlTest(x,y),rotate(
L, 1),rotate(L,-1,))->L
:PxlChg x,y
:x+L[1]->x:y+L[2]->y
:EndWhile:EndPrgm

For the less informed:
A "While" loop was used over a "Loop" or "Goto" becuase it is 10% faster. Try it for yourself!
A "When" statement was used because it's just as fast, but uses less space.

User avatar
Hangar
Posts: 171
Joined: Fri Nov 23, 2007 3:41 am UTC

Re: Ti Calculator Programing

Postby Hangar » Sat Jan 19, 2008 7:19 pm UTC

I once tried to write a text adventure in my TI-89. My first real attempt at programming. I'd tried to learn C on my own before, but got stuck around pointers due to the lack of a compiler. I was bored in math class, so I'd play with my graphing calculator. I once wrote an essay on that thing.

So I started a game, and before long, it got too big for basic, so I got a usb cable and found a C compiler. I spent a lot of time on an intro screen, drawing a bitmapped image on a grid and converting it by hand to hexadecimal. I also built a really simple parser for it (command string contains x word is all you need for a text adventure) and got the keys working so that you didn't have to hold any special buttons down like you normally did. I built a couple rooms, but ran out of RAM really quickly. I managed to extend the memory by running in some mode that disabled the main OS or something, but I ran out of RAM while writing the help files. The strings were all stored statically in the binary, but I didn't understand RAM enough to know to offload them to a file.

Was a cool idea for a text adventure though. Based on the idea of a specific type of time travel. (Background spoilered for length.)
Spoiler:
You were a college student who needed a book from the library to complete an essay due the next day. You get off work and come to the library, but it's closed. So you decide to try to break in. I managed to finish most of the outside of the library. There were half a dozen ways to get in, though some required different stats. You had strength, dexterity and intelligence. With strength, you could smash stuff open more easily, dexterity would give you more accuracy when you threw stuff, and intelligence would keep you from doing anything really stupid (for example, touching a live power cable).

You also had a bunch of other stats, like hunger, thirst and sleepiness. If you fell asleep in an unsafe area, you could be mugged or killed. There were a couple health-related stats. Like if you cut yourself, you'd start bleeding and losing health for a while. And time played a little bit of a role, too. Inside the library, a security guard would be making rounds. And after a little while, a car would come along and crash into yours. If you're inside, you die. But otherwise, the bumper of the other car came off (one of those old, dense, metal bumpers) and you could use it to break the main window of the library. You could also break it if you had enough strength, but there was a good chance you'd cut yourself.

Anyway, the story of the game, as you'd figure out, is that there was a small group of people who survived Armageddon. Many were scientists and conducted research to try to better the lives of those present. During one agricultural experiment, they noticed a small amount of mass disappearing. Eventually, they discovered that mass was going back in time. They poured all their efforts into researching the phenomenon and came up with a servicable sort of portal.

So a team headed back in time 75 years and managed to avert the accident that had destroyed the world. They were greeted as heroes and headed back into the portal to get the rest of those left in the post-apocalyptic era. However, something very strange happened. When they went back through the portal, they found themselves in a huge crowd of people, many of whom they'd never seen before. To the people who were left behind in the post-apocalyptic era, it appeared as if a few people went into the portal, then moments later, a huge amount of people had come out. They were perplexed. When a few tried returning through the portal, they found themselves in a wholly different world.

As it turned out, these portals could only be used to transcend time in a roundabout way. When a few people enter the portal, they go back in time, but start a separate thread of events. When returning through the portal, they will return to the old thread at the time they left, but the portals will not sync up until the new thread catches up to the old one. All the other people were those who had entered the portal throughout those 75 years. When they went back, they were forgotten, and history had deemed the apocalypse a hoax.

But these scientists were afraid of an Apocalypse occurring again and so decided to remain in their own thread, and create others in the hope that more varied worlds would cause more stability. Originally, they came from a world made up of empires. The first experiment they tried was the esoteric Greek idea of Democracy once explored in a tiny idealistic revolt in New England. For security reasons, they created the new portal in the other time thread. So they went back to the early American colonies and turned a little historical footnote into the creation of a new country. It was a great success. However, time caught up and a German named Hitler had toppled Democracy and taken over the world.

They didn't try to fix this world, because they were mainly concerned with stability. This facist world hadn't exploded like theirs, so it was deemed viable. But they still wanted to try Democracy. So a group went back in that altered world. They had some trouble infiltrating the movement early on, but were able to replace Hitler in the second half of WWII. They made sure Germany lost the war. It worked, but another threat came in and seized control.

The world they found was flooded with Communism. Again, this was a viable world, so they tried again, much more successful this time by limiting political and corporate leaders from taking as much advantage of the proletariat. And finally, it worked.

After that, there were a couple more worlds exploring what would happen if Rome and Greece were never toppled, and then a world I called Sin. It would have been a world where morality never took hold.

The library was the entrance to one of these portals, and would have led to the Roman world. The game would be about discovering each world until you managed to get to the apocalypse.


I also tried to write a shooter that was sort of a randomly-generated maze, but I wrote the game all at once, then tried to debug it. Didn't work. (The compiler was at home, but I wrote most of the game on the calc at school.)

User avatar
b.i.o
Green is the loneliest number
Posts: 2519
Joined: Fri Jul 27, 2007 4:38 pm UTC
Location: Hong Kong

Re: Ti Calculator Programing

Postby b.i.o » Sun Jan 20, 2008 2:36 am UTC

Amnesiasoft wrote:
Silver2Falcon wrote:TI's is that Basic is ridiculously slow.

Mainly because it seems to fragment and leak memory very badly. Most BASIC games I've written run just fine for a while, then slow down until I get a memory error.


Ahhh, yes, that can be a problem in TI-BASIC as well if you don't take care to clear variables after you're finished with them. Since all the variables are system variables they retain their values after you're done with the program unless you specifically get rid of them.

User avatar
Sc4Freak
Posts: 673
Joined: Thu Jul 12, 2007 4:50 am UTC
Location: Redmond, Washington

Re: Ti Calculator Programing

Postby Sc4Freak » Sun Jan 20, 2008 6:43 am UTC

Silver2Falcon wrote:
Amnesiasoft wrote:
Silver2Falcon wrote:TI's is that Basic is ridiculously slow.

Mainly because it seems to fragment and leak memory very badly. Most BASIC games I've written run just fine for a while, then slow down until I get a memory error.


Ahhh, yes, that can be a problem in TI-BASIC as well if you don't take care to clear variables after you're finished with them. Since all the variables are system variables they retain their values after you're done with the program unless you specifically get rid of them.

That's what the "local" command is for. It declares local variables that don't persist after program execution.

User avatar
Amnesiasoft
Posts: 2573
Joined: Tue May 15, 2007 4:28 am UTC
Location: Colorado
Contact:

Re: Ti Calculator Programing

Postby Amnesiasoft » Sun Jan 20, 2008 7:40 am UTC

Sc4Freak wrote:That's what the "local" command is for. It declares local variables that don't persist after program execution.

There is no local on the TI-83, which is what I'm talking about. It seems to just fragment memory on those things by changing variable values.

User avatar
b.i.o
Green is the loneliest number
Posts: 2519
Joined: Fri Jul 27, 2007 4:38 pm UTC
Location: Hong Kong

Re: Ti Calculator Programing

Postby b.i.o » Sun Jan 20, 2008 7:21 pm UTC

Amnesiasoft wrote:
Sc4Freak wrote:That's what the "local" command is for. It declares local variables that don't persist after program execution.

There is no local on the TI-83, which is what I'm talking about. It seems to just fragment memory on those things by changing variable values.


Yeah, it doesn't exist on the 83+/84+ either. Would make things so much more convenient :?

User avatar
War_Hero
Posts: 13
Joined: Sun Feb 17, 2008 7:41 am UTC

Re: Ti Calculator Programing

Postby War_Hero » Tue Feb 26, 2008 1:34 am UTC

Dude, matrices are included in the calculator. I'm pretty experienced with Ti84/83 progamming. What specificaly would you like to know?
Image

User avatar
Military
Posts: 15
Joined: Tue Feb 05, 2008 3:30 am UTC

Re: Ti Calculator Programing

Postby Military » Tue Feb 26, 2008 4:21 am UTC

I have two programs on my Ti83 one which is the quadratic formula, which is invaluable if you can't factor quickly in your head and the other is just a time waster, guess a number btw 1 and 5 place a certain amount of your 'money' on you being right and if you are then you win that * a multiplier no real purpose but it can be interesting when you always guess 4 and that number only comes up when your running low and switch to 2 which came up 8 out of the last 10 times

User avatar
aeki
Posts: 109
Joined: Fri Feb 22, 2008 12:25 am UTC

Re: Ti Calculator Programing

Postby aeki » Tue Feb 26, 2008 4:44 am UTC

Yeah, I had several trigonometry functions programmed into my TI-83 because I hated doing the same calculations over and over again. I played with branching menus in my spare time but it was mostly typing out train-of-thought babbling and lyrics of whatever song was in my head at the time than an actual coherent storyline.

I had tetris downloaded on it from somewhere though, that was a useful way to pretend to be working.

User avatar
The Hyphenator
Posts: 791
Joined: Mon Nov 19, 2007 2:16 am UTC
Location: The Shades, Ankh-Morpork

Re: Ti Calculator Programing

Postby The Hyphenator » Wed Feb 27, 2008 12:23 am UTC

Amnesiasoft wrote:
Silver2Falcon wrote:TI's is that Basic is ridiculously slow.

Mainly because it seems to fragment and leak memory very badly. Most BASIC games I've written run just fine for a while, then slow down until I get a memory error.

Memory error? Really? I've made tons and tons of games in BASIC, and I've never gotten a memory error. Maybe I just don't run them for long enough. And as for how to make them not ridiculously slow: optimize lots. Seriously, you can do stuff like...

Code: Select all

:getkey/->/G
:A+(G=34)-(G=25)/->/A
:B+(G=26)-(G=24)/->/B

...where A is the Y-coordinate and B is the X. And /->/ is the store symbol. If you put this inside a while loop or something, it increments/decrements A and B based on the arrow keys the user presses. Sure, these make your code completely unreadable, but the language is pretty unreadable to begin with.

Oh yeah, one more thing: Xlib is the graphics programmer's best friend. You can do all kinds of cool stuff with it, like draw rectangles, sprites, tile maps, get free ram, have 255 pictures instead of 10, etc. Perhaps most importantly, you can choose when to update the screen, making games tons faster.
The image link changes whenever I find a new cool website.
Spoiler:
Image

User avatar
Aperfectring
Posts: 252
Joined: Fri Sep 07, 2007 3:47 am UTC
Location: Oregon (happily)

Re: Ti Calculator Programing

Postby Aperfectring » Wed Feb 27, 2008 1:20 am UTC

The furthest I got programming anything original was:

I was in Algebra II, and tended to solve all of the problems in my head, but my teacher was an ass and would dock me points for not showing work, even if I got the answer right. I created a program for my Ti-85 which would not only solve any Algebra II equation which came at it, but would also display all the work necessary to get by the teacher's scrutiny. After a couple weeks of using it (making sure I got at least 5 or 6 homeworks back), I showed it to the teacher, and he never made me show work again.
Odds are I did well on my probability exam.

User avatar
Arancaytar
Posts: 1642
Joined: Thu Mar 15, 2007 12:54 am UTC
Location: 52.44°N, 13.55°E
Contact:

Re: Ti Calculator Programing

Postby Arancaytar » Fri Feb 29, 2008 1:55 pm UTC

I've written a few trig functions for my TI-83 graphing calculator (that's 83 without a plus. I feel old.), along with several physical formulae (Boyle's law, etc.) and a dice-roll utility that could also calculate averages and ranges.

This was actually my first foray into programming after Logo. I remember doing some Hello World stuff with Java too, but the words "public static void main" were only a magical incantation that I copied off the board without even understanding why it could not be "void main static public", so it doesn't really count.
"You cannot dual-wield the sharks. One is enough." -Our DM.
Image

User avatar
Berengal
Superabacus Mystic of the First Rank
Posts: 2707
Joined: Thu May 24, 2007 5:51 am UTC
Location: Bergen, Norway
Contact:

Re: Ti Calculator Programing

Postby Berengal » Fri Feb 29, 2008 2:14 pm UTC

Arancaytar wrote:I've written a few trig functions for my TI-83 graphing calculator (that's 83 without a plus. I feel old.), along with several physical formulae (Boyle's law, etc.) and a dice-roll utility that could also calculate averages and ranges.

This was actually my first foray into programming after Logo. I remember doing some Hello World stuff with Java too, but the words "public static void main" were only a magical incantation that I copied off the board without even understanding why it could not be "void main static public", so it doesn't really count.

It can, in fact, be "static public void main". As for the incantation-factor, it is indeed great. I took to programming really easily when I started uni, but not everyone in my cs class were as lucky as me. "public static void main" remained mystical and esoteric for months into the semester for one of my friends. She thought all programs were "class <ProgramName>{public static void main(String[] args){ /*code*/}}" for the longest time, and that regular programs just had lots of code in the /*code*/ part...
It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.

User avatar
Arancaytar
Posts: 1642
Joined: Thu Mar 15, 2007 12:54 am UTC
Location: 52.44°N, 13.55°E
Contact:

Re: Ti Calculator Programing

Postby Arancaytar » Mon Mar 03, 2008 8:38 am UTC

... depressingly, that is true for a few Java programs I've seen. =P
"You cannot dual-wield the sharks. One is enough." -Our DM.
Image


Return to “Coding”

Who is online

Users browsing this forum: No registered users and 8 guests