Here's all the stuff I have stored on my graphing calculator, in case you were wondering (and/or for my own reference). I wrote all of it myself over the past seven years or so.
AAA: a placeholder for small temporary programs, e.g. if I want to experiment with some sequence to look for patterns but don't need to keep the coding for later.
ABCSPRAC: Abacus Practice; generates two random numbers and an operation (+, -, x, ÷), waits for user to press Enter, and displays the answer.
ANT: checks if current pixel is black or white; if black, changes it to white, turns left, and moves forward; if white, changes it to black, turns right, and moves forward. Leads to some interesting designs, especially if there's already something on the screen. Based loosely on a discussion of emergent properties in Science of Discworld
BAB3: uses the Babylonian Method to approximate cube roots (see below).
BABYLON: uses the Babylonian Method to approximate square roots. Suppose you want to find the square root of 12. Start by picking a guess; let's say 3. But 3*3 isn't 12; 3*4 is 12. This means that the square root of 12 must be between 3 and 4. The midpoint would be 3.5, so use 3.5 as a new guess and start the process over. But 3.5*3.5 isn't 12; 3.5*3.429 (approx.) is 12, so the square root of 12 must be between 3.5 and 3.429. The midpoint would be 3.4645, so we use 3.4645 as a new guess and start over... and so on. By hand it's tedious, but a calculator program can perform such repetitive tasks extremely quickly. I wrote this for a class in grad school called Topics in Analysis.
BALL: displays a single pixel bouncing off the walls of the screen (and tracing its path). Initial velocity is chosen randomly; velocity can be influenced using the arrow keys.
BALLGRAV: same, but with gravity.
BIRTHDAY: calculates the probability that at least two people have the same birthday in a group of n
BISECTIN: the Bisection Method; approximates the x-intercept of a function in a similar fashion to the Babylonian Method. The user picks two numbers as guesses (an upper bound and a lower bound between which the intercept must be); the program finds the midpoint between those guesses and uses that as either the new upper bound or the new lower bound (depending on whether the function's value there is positive or negative) and starts the process over again. Also for Topics in Analysis.
BOUNCE: displays the word "BOUNCE" bouncing around the screen. Rather silly, I'm afraid.
BRIKDRAW: an attempt to make a Breakout-style game. It kinda works but it's really boring and there's no way to lose.
BURNSHIP: an attempt to draw the Burning Ship
, a fractal somewhat similar to the Mandelbrot Set. Way too slow. I should try it in LOGO instead.
CIRCINV: displays a circle on the screen, allows user to select a point, and draws the circular inversion of that point (sort of like a reflection, but across the circle rather than across a line). It's useful in certain branches of geometry and I think it might be related to cylindrical mirror anamorphoses
. M.C. Escher was probably into it too.
CTROFMAS: given two point masses and the distance between them, finds their center of mass. I wrote it for my own use when I was teaching high school algebra/physics as a quick way of checking students' answers.
DICE: prompts the user for number of dice and number of sides per die, then simulates rolling those dice and displays the total. A nice time-saver for RPGs.
DIRFIELD: given a differential equation, draws a direction field for it. The solution to a differential equation is a curve, or rather a family of curves; the direction field is a grid of small line segments whose direction shows which way a solution curve would be going if
it passed through that point. A very useful visualization tool.
DRAWPTRN: fills in pixels on the screen based on a certain algorithm to see if interesting patterns result. Currently I have it set to "if the x-coordinate and y-coordinate are relatively prime, color the pixel black," which does indeed yield an interesting pattern. Might look nice on fabric. I am reminded of the bit in The Difference Engine
about a fabric made by Ada Lovelace "feeding raw algebra into a Jacquard Loom."
DRAWRAND: same, but the algorithm is "flip a coin to decide whether to color the pixel black or white." Silly.
E: displays the values of (1+1/n)^n as n grows larger and larger, demonstrating that this gradually approaches 2.71828... or e
EULER: uses Euler's Method to approximate the solution of a differential equation. It's essentially a numerical version of the direction field mentioned above.
EULERPAR: same, but for parametric equations.
FACTOR: given a whole number, lists all pairs of factors whose product is that number (e.g. given 45, it will list 1, 45, 3, 15, 5, 9).
FIBONACI: lists out as many Fibonacci numbers as the user requests.
GCDEUCLID: uses Euclid's Method to find the greatest common divisor of any two whole numbers.
GR8RACE: asks the user for the strength of gravity, the mass of the race car, the length of the race track, the coefficient of friction, the force the engine can provide, and the car's desired initial and final velocity, and tells the user where the driver should hit the brakes. I wrote this as a quick way to check students' answers for a project in the algebra/physics class.
JACOBI: I have no idea what this does. It appears to be an iterative method for approximating the solution to some sort of matrix equation, so I presume it was for Topics in Analysis. Probably something like the Bisection Method but with matrices?
LAUNCHV: given two numbers A and B and the strength of gravity, tells the user the initial speed and direction with which a projectile must be launched. I'm not quite sure what A and B represent; possibly the coefficients in the equation of the parabolic path the projectile is intended to follow. Another one for checking students' work in the algebra/physics class.
M47R1X: gradually fills the screen with random ones and zeroes. Silly.
MANDLBRT: draws the Mandelbrot Set by making a sequence of calculations for each pixel on the screen. Works well but is very very slow. I'm proud of it but I like my LOGO version better. Amusing trivia: I used the chorus of JoCo's song "Mandelbrot Set" song as my sole reference for programming this.
MANDLCHK: originally just checked if a single point, given by the user, is part of the Mandelbrot Set or not. Useful for checking students' work in the algebra/physics class. I later modified it to also display some neat graphs showing how exactly the aforementioned sequence of calculations converges
NEWTON: uses Newton's Method to approximate the x-intercept of a function. It starts with a user's guess as usual, then treats the function as a straight line near that guess and figures out where that line would hit the x-axis (easy enough) and uses that x-value as a new guess to start the process over again. Very effective. Another one from Topics in Analysis.
ORANGE: did you ever see that old logic puzzle where you start with a cup of water and a cup of orange juice and you put a spoonful from cup A into cup B and stir, then put a spoonful from cup B into cup A and stir, and so on over and over again? No? Well anyway this program simulates that.
PASCAL: draws Pascal's Triangle with all multiples of n
removed. Very neat patterns, especially for prime n
. I wrote this while student-teaching Algebra II (and later used it in a presentation for Topics in Analysis) and I'm very proud of it.
PASCLROW: displays all the numbers in row n
of Pascal's Triangle.
PASCNORM: displays some scatterplots that are probably intended to imply that the larger rows of Pascal's Triangle begin to approximate the normal distribution from stats? I'm not sure I remember writing this one, but it's definitely my style.
PASSWORD: this isn't a program; it's just where I store the password to the current level on a built-in puzzle game called Blockman. I haven't actually played it in years.
PCOUNT: not quite sure what this does. I think I was using it to count how many steps it takes for a certain p-series, specifically (10/11)^1 + (10/11)^2 + (10/11)^3 + ..., to reach 9, then 9.9, then 9.99, then 9.999, then 9.9999, etc. as it converges towards 10. I think I felt like I was on the verge of discovering something important but then realized that, when examined from a different point of view, is was pretty obvious and mundane so I gave up. I forget what exactly it was though.
PRFACTOR: similar to FACTOR, but instead of listing pairs of factors, it breaks the number down into its prime factors. I was rather proud of this one; it's not a very efficient algorithm but it's one I made up myself and it's a little faster than brute force.
PSERIES: similar to PCOUNT, but without a counter to keep track of how many steps it's taken.
PTRSBURG: simulates the so-called "St. Petersburg Lottery," a somewhat famous exercise in probability theory about a hypothetical gambling game set up in such a way that the only way it can be truly fair is if the cost to play is infinite.
PUNKED: another prank. When the program is running, it looks
like the ordinary home screen, and allows the user to type in most simple calculations as normal, but multiplies each result by a random modifier between .99 and 1.01... leading to numbers close
to the answer but with something wrong
about them. Intended for use on students who rely too much on their calculators but never actually deployed.
PYRAMID: an attempt to extend Pascal's Triangle into three dimensions. Enter a number and the program will give you a square matrix representing a cross-section of Pascal's (Square) Pyramid that many layers down from the top. I've since realized that a pyramid whose cross-sections are equilateral triangles is actually more useful, but this one still has some neat patterns.
QUADFORM: uses the quadratic formula to solve a quadratic. Occasionally useful; mainly I keep it around as a quick and simple example to show students how programming works using a mathematical concept they already know.
QUADITER: uses an iterative method similar to the Babylonian Method to approximate the solutions of a quadratic--as usual, user picks a guess and program repeats some calculation to get a closer guess, and a closer guess, and a closer guess, and so on. Written for Topics in Analysis, of course.
ROCKET: given three numbers (acceleration of gravity, rocket's velocity when observed, and height at which it was observed, I think?), the program calculates when the rocket was launched, when the rocket will land, and how high it reaches. Another one for the physics/algebra class, of course.
ROCKET2: a prank on my co-teacher. I described it to him as "an improved version of the ROCKET program," but it exaggerates the launch time by a factor of 100, gives the land time as π seconds, and claims that the rocket will reach a height of "a shade of green" meters at time "fish" seconds. Silly.
ROT13: given a letter, converts to a number (A=1, B=2, C=3, etc.), then adds 13 and converts it back to a letter. A simple but classic way of encrypting a message. Fun fact: the process of decrypting this particular code is exactly the same as the process of encrypting it, because 13 is exactly half of 26.
SFBDICE: similar to DICE, but modified for use with the damage allocation chart in Star Fleet Battles.
SFBDSTNC: an attempt to create a program that could quickly calculate the distance between any two hexes on a hexgrid based on their coordinates using the hex-labeling system in Star Fleet Battles. Never figured out how to get it to work.
SFBSPEED: type in your ship's speed and this program will tell you when it should move during the turn. Very useful.
SIERPRND: uses a random-walk algorithm to generate, rather surprisingly, the Sierpinski Triangle
. Fun to watch.
SLIDESHO: a quick way to display saved images without having to go through a bunch of menus each time. Nice shortcut for showing off related graphs, variations on Pascal's Triangle, zoom-ins of the Mandelbrot Set, etc.
SNOCRASH: creates some small files and makes them bigger and bigger until the calculator's memory is completely full. Silly.
STUDENTS: displays the name of a student, randomly chosen from a list. I used this when I was teaching high school to call on students randomly.
TEMP: converts temperature between celsius and fahrenheit. Another one I use to teach students the basics of programming.
TWENTY4: simulates an old French dice game called Twenty-Four (roll two dice 24 times; if you get double sixes at least once, you win; if not, you lose). Mainly of historical interest; apparently Pascal was inspired to invent modern probability theory when a friend asked him if this was a fair game or not. (Turns out that losing is more likely than winning, but only very slightly.)
TWENTY42: same, but runs the game many times and then displays how many wins vs. how many losses.
VECSPIN: user enters a 2x2 transformation matrix. Program simulates a vector of length 1 spinning around the origin, but displays the result of said vector multiplied by the transformation matrix instead.
VECTRAIL: same as above, but leaves a trail.