Welcome to Cemetech Ranaakamarth. Do you want to introduce yourself in the appropriate topic?

I remember For loops were one of the first things I learned for TI Basic, so I never had a problem with things like that.
Welcome to Cemetech, Ranaakamarth! Nice one; I think a lot of us did things like that before we discovered what loops were. Smile Be sure to Introduce Yourself in the relevant topic, and we were also trying to say hello to you from the SAX chat widget in the left sidebar. Smile
Those were the good days. The best part was, everyone who you showed still thought you were a genius for figuring it out Razz

I actually showed another guy how to program on his 86 in BASIC, and he made a pretty decent Choice-based menu game. I threw in a little death sequence so whenever you died by chuck norris he was roundhouse kicking you in a random place.
willrandship wrote:
Those were the good days. The best part was, everyone who you showed still thought you were a genius for figuring it out Razz

I actually showed another guy how to program on his 86 in BASIC, and he made a pretty decent Choice-based menu game. I threw in a little death sequence so whenever you died by chuck norris he was roundhouse kicking you in a random place.
Haha, very nice, good for you. Wink Do you have any examples of your early code?
Here were my two first programs.... still have them because it wasn't all that long ago for me, about 3 weeks!


Code:

-------------Counter-------------

:ClrHome
:0→Y
:Disp "VISIBLE?"
:Input "(Y=1,N=0)",D
:Input "START FROM",Y
:Disp " "
:Input "COUNT TO ",X
:If D=1
:Then
:Goto 1
:Else
:Goto 2
:End
:Lbl 1
:Y+1→Y
:Disp Y
:If Y<X
:Then
:Goto 1
:Else
:Goto 3
:End
:Lbl 2
:Y+1→Y
:If Y<X
:Then
:Goto 2
:Else
:Goto 3
:End
:Lbl 3
:Disp " "
:Disp "DONE COUNTING TO",X

---------Guessing Game--------------

:ClrHome
:randInt(0,100)→X
:0→G
:Disp "GUESS A NUMBER","BETWEEN"," 0 AND 100"
:Lbl 1
:Input "",Y
:G+1→G
:Disp Y
:If X=Y
:Then
:Disp "CORRECT"
:Disp "YOU GUESSED IN"
:Disp G,"TIMES"
:Goto 2
:End
:If X<Y
:Then
:Disp "GUESS LOWER"
:Goto 1
:End
:If X>Y
:Then
:Disp "GUESS HIGHER"
:Goto 1
:End
:Lbl 2
:Disp "GOODBYE"


Ya, as you can see, I did not know how to use loops... the counter got really slow after about 150 on my Ti-83+. Now i have upgraded myself to using loops, and now moving on to games, I think im going to start with a version of snake.
Nice! Good to see you are learning more about programming. And, if you need any help, we are always here. Wink

EDIT: Nice necropost Smile
OH. whoops, i sorta forgot to look at the date, usually i assume the first page is somewhat recent... Shock
One of my first real programs was quite terrible. I knew about Goto, but not about any loops. I knew how to use If.

I wrote a clock program. 90 percent of the lines were this:
:X->X
to cause a delay, and the others consisted of If statements, some math, and a few Outputs.

That was years ago, I don't even have that calculator anymore. (It was an 84+BE that I lost prior to having my 86)
i mark i wrote:
Ya, as you can see, I did not know how to use loops... the counter got really slow after about 150 on my Ti-83+. Now i have upgraded myself to using loops, and now moving on to games, I think im going to start with a version of snake.
Do you understand what a memory leak is, and why Goto causes it? If not, I have a book to biasedly push in your direction.
Ya, i now know what a memory leak is, three or so weeks ago i did not though. As i said, those were my first two programs, current ones use loops and such. I am looking at your book either way though, i may end up getting it.
Very Happy

I guess all of us started out using goto's instead of loops. I thought i was the only one!
Does anyone remember my functional Pokemon Demo.....

with >100 sub-programs? Very Happy
And I thought 50 for Sunrise 3 was a lot!
While not as dramatic an example, I dug up a couple of small programs from my earliest programming days in 1994. The TI-81 was my first programmable device (no PC until 1997!). There was:


Code:

Prgm6:NUMGUESS
# Apparently this was just a two-player only version, though I'm sure I had made ones where the calculator generated the number
:0→I
:ClrHome
:Disp "LETS PLAY NUMBER GUESS!"   # No apostrophe char on the 81, and ending quotes are required unlike 83+/84+
:Lbl 1
:0→H    # H isn't even used anywhere in the program. Go figure.
:Disp "ENTER A NUMBER FOR ANOTHER PERSON TO GUESS."
:Input N
:ClrHome
:Disp "NOW GIVE THIS TO THE GUESSER."
:Pause
:Disp "HOW MANY CHANCES DO YOU WANT?"
:Input C
:Lbl 2
:Disp "WHAT DO YOU THINK THE ANSWER IS?"
:I+1→I
:Input T
:If T<N
:Goto 4    # 81 also doesn't have If…Then, just If
:If T>N
:Goto 5
:If T=N
:Goto 6
:Lbl 5
:If I≤C
:Goto 9    # Mmm, spaghetti code
:Disp "TOO HIGH."
:Goto 2
:Lbl 4
:If I≤C
:Goto 9    # Redundant spaghetti code, even
:Disp "TOO LOW."
:Goto 2
:Lbl 6
:Disp "THIS ANSWER IS CORRECT. GOOD JOB!"
:Pause
:Lbl 0
:0→I
:Disp "PLAY AGAIN?"
:Disp "1-YES"
:Disp "2-NO"
:Input θ
:If θ=1
:Goto 1
:End
:Lbl 9
:Disp "THAT WAS JUST YOUR LAST CHANCE"
:Disp "THE NUMBER WAS"
:Disp N
:Pause
:Goto 0


which could be optimized to:


Code:

:Disp "NUMBER GUESS!   ENTER A NUMBER  FOR ANOTHER"
:Disp "PERSON TO GUESS."    # One byte shorter than five more spaces
:Input N    # The 81 was primitive. Input has no custom input messages, must use Disp as above.
:ClrHome
:Disp "NOW GIVE THIS TOTHE GUESSER."
:Pause
:Disp "HOW MANY"
:Disp "CHANCES?" # Can't provide multiple arguments to 81's Disp, so we have to do it this way
:Input C
:Lbl G
:Disp "YOUR GUESS?"
:Input T
:If T<N
:Disp "TOO LOW"   # At least this isn't TI-99/4A BASIC, where you *have* to use Goto with If!
:If T>N
:Disp "TOO HIGH"
:If T=N
:Goto W
:DS<(C,1    # No looping commands! It's either Goto or IS>/DS<
:Goto G
:Goto L
:Lbl W
:Disp "RIGHT. GOOD JOB!"
:End
:Lbl L
:Disp "NO MORE CHANCES!THE NUMBER WAS"
:Disp N


Or a somewhat Rube Goldberg-esque “8-Ball” type program, which looked like this:


Code:

:Disp "ASK A YES/NO QUESTION AND PRESS ENTER."
:Pause
:IPart (Rand*100)→R
:If R≥80
:Goto 1
:If R≥60
:Goto 2
:If R≥40
:Goto 3
:If R≥20
:Goto 4
:If R<20     # This line is superfluous :-)
:Goto 5
:Lbl 1
:Disp "ASK AGAIN LATER"
:End    # End on the 81 was the equivalent to Return on the later models. That was its only purpose, since there were no looping or block commands
:Lbl 2
:Disp "YES, OF COURSE."
:End
:Lbl 3
:Disp "MY REPLY IS NO."
:End
:Lbl 4
:Disp "IT IS CERTAIN."
:End
:Lbl 5
:Disp "DONT COUNT ON IT"


No idea why I did all that when I could have just:


Code:

:IPart (5Rand→R
:If R=0
:Disp "ASK AGAIN LATER"
:If R=1
:Disp "YES, OF COURSE"
:If R=2
:Disp "MY REPLY IS NO"
:If R=3
:Disp "IT IS CERTAIN"
:If R=4
:Disp "DONT COUNT ON IT"
woah. hey, i used something like this when i didnt know that adding a zero at the end of the line( command could erase:


Shade(Xmin,Xmax,Ymin,Ymax)
Px-Off(34,28
Px-Off(35,28
Px-Off(35,29
.........................................(gotta stop before i make dotmageddon)

and used labels for repeating a part of the animation.
even worse, i let this run, and then went on vacation.
when i came back, i got a ram-clear because the batteries died during execution. it took 2 weeks for this program.
a weekend later
LuxenD wrote:
woah. hey, i used something like this when i didnt know that adding a zero at the end of the line( command could erase:


Shade(Xmin,Xmax,Ymin,Ymax)
Px-Off(34,28
Px-Off(35,28
Px-Off(35,29
.........................................(gotta stop before i make dotmageddon)

and used labels for repeating a part of the animation.
even worse, i let this run, and then went on vacation.
when i came back, i got a ram-clear because the batteries died during execution. it took 2 weeks for this program.
a weekend later

*Compynerd255's eye twitches involuntarily
That reminds me of a time when my brother tried to make a starry night sky picture on his Casio fx calculator, and he was unaware of the Pxl-Off drawing function, so he worked painstakingly to draw black pixels around all of his starry shapes, because he thought that if he made a mistake, he'd have to start all over again (and I think he did at one point). The picture looked awesome, though.
Of course, when you fixed the Line problem, how fast was the animation?
  
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 2 of 2
» 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