Hey everyone, I'm sure this isn't the usual kind of post that appears in this forum, but I thought it would be kind of nice to have on the site. I'm documenting my mission of learning to program on a calculator!!!
A big reason I haven't tried up until now is because it always seemed like a very daunting task to me, and I think a thread of someone with zero coding experience learning to code could help a lot of others feel confident enough to start learning, too!
For anyone wanting to start as well, I am learning off of the Calculator Programming Book from the site's Resources section.

Hello World
The basic Hello World program!! This was like, shockingly easy, actually... I wasn't expecting it to be just one line of code.


Quadratic Solver
Again, very very easy. I'm starting to feel a little bit silly for being so scared to start!


Guessing Game
For this one, I decided to not follow the guide and instead try it myself first.

This version works, but it's not very fun. I then followed the guide's version. Well, not fully. I accidentally missed the line that sets the attempt counter to 0 at the beginning, and since I didn't want to retype everything, I just ignored that feature entirely. 😄 Although it was only a single line longer, it was much more fun now.


That is as far as I have gotten in my coding so far!! I will edit this later when I get more stuff done. Unless this gets removed for breaking some sort of rule, and in that case, I am very sorry moderators!!!

~~~~~~~Part 2~~~~~~~

Hey all, I've returned! With not a lot of progress, still... I'm working on it, though!

Before I get to the actual updates, I have a correction on my previous version!
Quote:
I accidentally missed the line that sets the attempt counter to 0 at the beginning, and since I didn't want to retype everything, I just ignored that feature entirely.

Turns out to add or correct something, you don't actually need to delete anything! For people that don't know, you can do insert-typing mode instead of replace-typing mode by pressing "ins!" ([2nd], [del]) That lets you insert numbers before the number you have selected, instead of overwriting the number. For entire lines, you can use the program context menu with f5! ([alpha], [graph]) Then just hit "Insert Line Above," or any of the other incredibly useful commands!

Simple Animation
This one was a simple, easy animation. It just makes an equals sign go from left to right every time ENTER was pressed.


Square Calculator
This program was by far the easiest! It just calculates the square of a number!


Conversation
Going from very simple to much more complicated, this program takes user input and displays it as a sentence! I'm still working on it as I type, actually... Here is what I have so far.

It's not very pretty...
About five minutes into the future (my username is fitting here), and I've made this!

Much better. It looks nice now!!!

Multiplication Question
This one is not part of the book, but rather a challenge I gave myself. Program a simple test! This just asks you a simple multiplication question. Here is the rough draft!

Again, not very good looking. Let's go over to future me with the revamped, pretty-ified version!



Future me here, this time I made it look much better by using my recently-made-favorite command, "Output("!!!

The Code (Not all of it, I won't make you look at all of the code for everything I make.)

There it is! Now everything is clearly laid out and it even shows what the correct answer is when you get it wrong! Man, I'm great at this... Since I am so great at this, I am going to leave this update here while I go figure out how to upload this Multiplication Question program here! Next update will have the link, unless I forget.

~~~~~~~Part 3~~~~~~~

Good morning everybody! My program was accepted!
You can find the download link here!

Back to my awesome coding progress.

Infinite Loop
This program seems completely useless, and that is because... it is. It just starts an infinite loop that will never end unless you press [ON]. But it showed me how to use Lbl and Goto commands! I actually had to sneak in a Pause to get a screenshot, since the loop moved too fast otherwise!


Guessing Game UPDATE
You guys remember my guessing game from earlier! Well, I deleted that before I realized I needed to keep that so I could edit it for this practice! Oops! I went back and just copied down the guide's version, so that's why it looks a little different.

The guide wants me to change it to use Lbl and Goto tags! So, I'm going to do that.

This was my attempt, which made the code much longer and more complicated, so I'm going to assume I did it wrong. It still works, however!

This is what the guide did. Wow. Okay, I'm a little embarrassed that I over-complicated it so much. Well, at least now I know, I guess!
(Also, I figured out how to cheat in the Number Guessing game!!! You can just use rcl N to instantly get the number in 1 attempt!)

More Updates
Now I get to learn how to add a fancy little menu! How fun!

I actually think I will add this to my multiplication program!

Perfect! And I also fixed what could have been a possible memory leak? Maybe. I'm not really sure if it was one or not. This is where I will leave my update off at so I can go update my program!!! See you guys later!
~~~~~~~Part 4~~~~~~~


My update was accepted!
Download Link Here


Wow, a separate post! I didn't even realize we had the budget for one of these... it's a dream come true. Apologies for the double post, everyone. I figured if the initial post just got way too long from edits, nobody would ever bother to read all of it! It's much easier to digest if its split up, I think. To avoid people being annoyed at me for double posting, however, I will make sure this update has lots of content!!!


Counting
Wow! A program that counts from 1 to 10! Revolutionary! This on its own might be enough to justify a new post!

This exercise taught me a little about For( loops.


Prompted Counting
This time the program asks you what number to start with, what number to end with, and even how much to count by!

Very fun and simple, just basic inputs and variables coupled with the For( loop.


Average Calculator
This one is neat, and actually useful! This automatically calculates the average of any numbers you put into it!

I actually want to show the code for this one, so its possible to follow along!

The Disp simply shows the instructions on how to use the program. "0→S" and "0→N" are just setting the Sum and the amount of Numbers to zero! "Repeat X=9999" starts a repeat loop that will go until the user inputs 9999. "Input 'VALUE: ',X" is the prompt for the user to input a number to add to the list to average. "If X≠9999" and "Then" simply just makes sure that what you put in wasn't 9999 before it can move on. "X+S→S" adds the number you inputted to the total Sum of what we're working with, and then sets that as the new Sum. "N+1→N" raised the amount of Numbers to divide by by one. The two "End" commands just close the "If/Then" and the "Repeat." The "Disp" shows the average of your numbers, and finally, the "Pause" just freezes the screen so you can actually read what the average is before it moves on!


Program Menu
This one is a little different, as I didnt really make any new programs. The next chapter in the book is teaching me how to call programs, so I challenged myself to make a menu that opens my different programs I've made!

Now isn't that neat?


Owned By
This program that shows a bit of text that just reminds everyone who owns this calculator. It's me, obviously.

But this program utilizes a subprogram called ZBorders that draws the border of zeroes around the screen!


Jumpscare
Another non-book program, this one simply runs, and then after a random amount of time, displays the text "BOO!" on the screen! I thought it would be fitting, with how close it is to Halloween!

The code is actually very very simple for this one.

It simply starts a repeat loop that goes on until X=1, then within the loop it sets X to any random number ranging from 1-1000, and then it tries again! When it finally succeeds, it says Boo!

This very simple one-line addition shows you each number it attempts while trying to get down to one.

It's actually surprisingly fun to watch! Lots of anticipation...
Hey, how about I add a menu?

And a help section?

Hey, this is looking good enough to upload!
...
Hey, it looks like I actually already uploaded it!
Download link here!
It's a Halloween miracle!


Moving Characters
This is huge progress, now I know how getKey works! The guide showed me how to make a simple program where I can move a character around!!!

It's, uh, not really something I can screenshot... You just have to trust me that it moves with the arrow keys!


Defensive Programming
The guide started talking about something called “defensive programming” in which you set limits in your code so the user doesn’t accidentally break something! This gave me the idea to try a simple form of this by making a program that asks you to choose a number from 1 through 10, and if you fail to do so, it just asks the question again!



Pong Paddle
Not from the book, but the “moving characters” code inspired me to make a movable Pong paddle! I don’t have the rest of the Pong game, but it’s a start! Maybe I’ll keep this program in my back pocket until I can figure out how to program more.


Get Key
There also was this simple program showing how to simply get a key's code number! Very helpful.


Eight Directions
Now it's time for me to modify my original Moving Characters code and allow more freedom of movement!!! I have to change from the arrow keys to the numpad though.
This wasn't really difficult, it was just more bug-fixing than usual. The actual execution was pretty simple, add four more "If K=" sequences that moved the character diagonally. Again, I can't screenshot movement, so just trust me.


But, looking at the guide showed me a different way to do it, using only four conditionals!
Let's compare these two bits of code.

The left, 8 conditionals. The right, only 4. The one with 8's code is easier to understand, like when 8 is pressed, go up, when 4 is pressed, go left, and when 7 is pressed, go up AND left. The second one, however, is more like if any key on the left side is pressed, go left. If any key on the up side is pressed, go up. It automatically combines left+up if 7 is pressed. It's a little more complicated, and very tedious to type each line, but it has a big benefit. It takes up less space.

EIGHTDIR (8 conditionals) takes up a whole 76 more storage units than EIGHTDTW! (4 conditionals)
This might not seem like much, but if you have a ton of programs on your calculator, you'll like to save as much room as possible!
There is one gameplay difference between both programs, however. The first, with 8 conditionals, doesn't let you slide against a wall if you press diagonal while against a wall. The second, however, does let you. Make of that what you will, some games will benefit from different systems.

Mouse Game
My first, fully functional game! Well, a game that doesn't ask you a question and wait for an input... My first FUN game! You are the mouse, M, and you run around the board, collecting the pieces of cheese before your hunger runs out!

Ignore the score of 360... The game is a little addicting. My hands hurt now... 😄
Unfortunately, I don't believe I have the license to release this game as a program on here, since I did copy a lot of it from the book. You'll have to learn how to make games yourself to play it! Mwahahaha...

With that, I think this post is definitely getting long enough, so I will end it here. Please be sure to reply with ideas for practice programs that me and other beginners can try! Don't hesitate to critique any of my code, I'm here to learn! Thank you guys, and I will see you in the next post. (Or edit...)
This doesn't count as a double post, you posted on two separate days. 😛
~~~~~~Part 5~~~~~~

Pong
My first ever "original" game! I challenged myself to create a simple Pong game with no help from the guide or any tutorials. Inside of the zip file is not only the game and a readme.txt, I also included the TI-Basic code in plaintext format for your reading pleasure. It's also fully commented for ease of reading.
Download Link Here


That is all for this update, it's a much shorter one since this is a relatively big project, at least compared to everything else that I've done. Don't forget to reply with suggestions for practice programs and advice! See y'all in the next update.
~~~~~~Part 6~~~~~~

This time, no fun surprise program release at the beginning... What a bummer! More normal progress.

Intro to graphscreen
This is basically an evolution of that first "Moving character" program that I made, but this time I used the graphscreen! Lots of freedom of movement now.

Again, I run into the issue of not being able to record GIFs... Does anyone know how? I'd love to show my programs in motion. For now, as usual, you just have to trust me that it moves.

Cursor
This is a very simple edit to the introduction to graphscreen program, where instead of drawing an M, it draws a computer cursor!

It utilizes a subprogram to draw the cursor each time, and it's not very fast. Since I'm on a CE instead of an 84+ like the guide is intended for, the cursor has to be double the size to even be comfortably visible! That makes the program much slower.
This one can't move diagonally. I should fix that.

Perfect! That image perfectly visualizes the fact that the cursor now has the ability to move diagonally.
I also got an idea.
Any time [5] on the numpad is pressed, it makes the cursor move faster, effectively raising the sensitivity of the mouse!

At the beginning of the program, C is set to 1, and all of the movement is multiplied by C! I, uh, didn't add a way to lower the sensitivity, but that's probably fine...

Painting
A simple painting program! How cool.

It has 8-direction movement and a pen toggle! No erasing, though, cause I never make mistakes.
...
Okay, now that I think about it, maybe I should add an eraser... For no reason...

There we go! Perfect! Also, the pen is 2x2 pixels, because otherwise the lines were super thin and didn't look very good.

Screen Filler
This is a program I made to understand the graphscreen pixels and the For( command better. It simply fills the screen with pixels.

(If you're curious, it takes EXACTLY 1 minute, 30 seconds to fill!)
It's actually very easy to modify. It's fun to watch, too!



Alright, I gotta stop playing with this now, or else I'll be playing with it forever...
If you're on PC, look at some of those patterns, and then zoom in and out on the webpage. It makes neat designs.

Graphing
This is a program that simply asks what you want to graph, and then graphs it!

Very simple code, too.

I also made this graph.


Point Screensaver
This is a simple screensaver that draws random shapes in random colors around the screen.

Here's what happens when you let it run while you grab a soda from the kitchen.

Looks like a bowl of Froot Loops!


This is all for today's update. Thank you for reading! And if you have suggestions for programs to make for beginners to learn, don't forget to reply with your ideas!
Nice work
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement