Thanks, as you can see I am trying.


Very Happy
tifreak8x wrote:
qazz42 wrote:
Yes I am only using them for the menu

Is there a better way?


I already learned that the labels are crap when doing the command GoTo


I use While loops, but they can get rather complicated if you don't properly keep track of what you are doing. But the code is fast.
As long as you structure your While loop logically and keep track of how it works, it doesn't get too horrible. SourceCoder's source tabbing feature FTW! Very Happy
Systematically become acquainted with every function and instruction that is available to you. Know their purposes, their origins, and what fundamentally sets them apart from one another – you don't want to find yourself hammering in nails with a screwdriver! Furthermore, don't stunt yourself with the notion that there's nothing left to learn about any one item's behavior. If you are beside yourself with self-satisfaction, then you won't see any reason to improve. What a shame that would be.

My advice: don't come up with programming concepts first and then look for the commands to cover them. Do what you can with what you have learned thus far, and then work on adding the next piece to your bag of tricks. In learning a new language, vocabulary should come before sentence structure: if you start by making a cluster of sounds that makes sense in only one context, you'll have missed the integral part of understanding what each word means as a unit, requiring you to either backtrack and figure it out to move ahead, or just move ahead and end up falling behind.

If anyone's post comes across as harsh, zap the emotion you feel by reading it and identify the gain. Humble pie is as filling and flavorful as you want it to be.
tifreak8x wrote:

Don't use stop, its bad coding style. Use 'Return' instead.
What if someone has OVER NINE THOUSAND nested sub-programs and wants to exit the entire game? In that case, I think Stop is a much better alternative to the ridiculous amount of memory so many returns would take.
xlibman wrote:
tifreak8x wrote:

Don't use stop, its bad coding style. Use 'Return' instead.
What if someone has OVER NINE THOUSAND nested sub-programs and wants to exit the entire game? In that case, I think Stop is a much better alternative to the ridiculous amount of memory so many returns would take.

As soon as you use Stop, your program is annoying or worthless to anyone using a shell. Also, you need to rethink their program structure because you are doing something wrong.
KermMartian wrote:
tifreak8x wrote:
qazz42 wrote:
Yes I am only using them for the menu

Is there a better way?


I already learned that the labels are crap when doing the command GoTo


I use While loops, but they can get rather complicated if you don't properly keep track of what you are doing. But the code is fast.
As long as you structure your While loop logically and keep track of how it works, it doesn't get too horrible. SourceCoder's source tabbing feature FTW! Very Happy


Lol, or be like me and write all the code out on paper first before putting it in the calc so it can be kept track of. :p
Yes I can understand this but you still need to understand I am not even remotely fluent in the language.


So to repeat what I said earlier, when I get more time I will familiarize myself with some more TI-BASIC.


I know only the basics so far and will go to more advanced stuff when my 2 weeks of pure stress are over.


EDIT: I get it, I replaced stop with return AND made my program MirageOS compatible.
qazz42 wrote:
I am totally unprepared because all I know is how to send files.

Don't worry, you'll learn how to do everything you need to do in class. Trust me, you're already ahead of the curve since you've already started to code for your calculator; Even after 4 years, most of my peers have no idea how to write a program.

qazz42 wrote:
you still need to understand I am not even remotely fluent in the language.

No problem, just keep coding, figuring out how everything works! Smile Try writing programs for math/science classes; for example, try writing a quadratic solver, or a program that calculates side lengths/angles of a triangle.

Weregoose wrote:

If anyone's post comes across as harsh, zap the emotion you feel by reading it and identify the gain.

I couldn't agree more. Good advice periodically comes dripping with sarcasm. Avoid antagonizing people who are trying to help you, even if they come across as a little harsh.

My (TI-Basic-related) thoughts:

1) The second and third ClrHomes are unnecessary, because the screen has already been cleared by the first ClrHome.

:ClrHome
:Menu("CHOOSE","DEATH",DE,"LIVE",LV
:Lbl DE
:ClrHome
:Output(4,4,"YOU ARE DEAD":Stop
:Lbl LV
:ClrHome
:Output(4,4,"IMMA FIRIN MAH LAZθR"
:Stop

2) You can save a few bytes by not including closing quotation marks

:ClrHome
:Menu("CHOOSE","DEATH",DE,"LIVE",LV
:Lbl DE
:Output(4,4,"YOU ARE DEAD"
:Stop
:Lbl LV
:Output(4,4,"IMMA FIRIN MAH LAZθR"
:Stop

3) (As stated before) swap "Stop" for "Return", and remove the last stop/return (you do not need it at the end of a program)

:ClrHome
:Menu("CHOOSE","DEATH",DE,"LIVE",LV
:Lbl DE
:Output(4,4,"YOU ARE DEAD
:Stop
:Lbl LV
:Output(4,4,"IMMA FIRIN MAH LAZθR
:Stop

4) You can save a few more bytes by using (shorter) 1 character label names.

:ClrHome
:Menu("CHOOSE","DEATH",DE,"LIVE",LV
:Lbl DE
:Output(4,4,"YOU ARE DEAD
:Return
:Lbl LV
:Output(4,4,"IMMA FIRIN MAH LAZθR


Once you've made those modification, you're left with:


Code:
:ClrHome
:Menu("CHOOSE","DEATH",D,"LIVE",L
:Lbl D
:Output(4,4,"YOU ARE DEAD
:Return
:Lbl L
:Output(4,4,"IMMA FIRIN MAH LAZθR


w00t w00t.

Making these modifications to save a few extra bytes of RAM may seem obsessive, especially when you're just trying to figure out how to make your code work, but ultimately it will make you a better programmer (who doesn't want smaller, faster programs?)

Good luck, and welcome to Cemetech!
Nice overview there, rthprog. If you get a chance, qazz42, might I recommend taking a gander at one or two of the tutorials that TIFreak8x has amassed?

http://tifreakware.net/tutorials/83p/b/
Yep I will read that when I have the time.


This program I deleted and I made my first,but crappy, GAME!!!!!!!




*cough*text-based*cough*



:ClrHome:Lbl M:ClrHome
:Menu("MONSTOR APPEARS","ATTACK",A,"DEFEND",D," @#!*% OUT",P,"SPECIAL ATTACK",SP,"QUIT",Q,"CREDITS",C
:Lbl A
:Menu("WEAPONS","PUNCH",PU,"SWORD",SW,"FIRE",FI
:Lbl PU
:Output(4,4,"1 DAMAGE"
:Pause
:Goto M
:Lbl SW
:Output(4,4,"10 DAMAGE"
:Pause
:Goto M
:Lbl FI
:Output(4,4,"100 DAMAGE"
:Pause :ClrHome
:Output(4,4,"WINNER"
:Return
:Lbl D
:Menu("SHEILDS","WEAK SHEILD",WS,"MEDIUM SHEILD",MS,"STRONG SHEILD",SS
:Lbl WS
:Output(4,4,"100DAMAGE TAKEN"
:Pause :ClrHome
:Output(4,4,"YOU LOSE":Pause
:Return
:Lbl MS
:Output(4,4,"50 DAMAGE TAKEN"
:Pause
:Goto M
:Lbl SS
:Output(4,4,"1 DAMAGE TAKEN"
:Pause
:Goto M
:Lbl P
:Menu("SPEED","FAST",FA,"SLOW",SL
:Lbl FA
:Disp "YOU GET AWAY":Pause :ClrHome
:Output(4,4," @#!*% WINNER"
:Pause
:Return
:Lbl SL
:Disp "HE EATS YOU"
:Pause
:ClrHome
:Output(4,4," @#!*% LOSER"
:Pause
:Return
:Lbl SP
:Menu("SPECIAL","GOD ALMIGHTY",GA,"CHUCK NORRIS",CN
:Lbl GA
:Output(4,4,"BOOM!"
:Output(4,4,"MθNSTER GOES TO @#!*% "
:Pause :ClrHome
:Output(4,4,"WINNER"
:Pause
:Return
:Lbl CN
:Output(4,4,"CHUCK NORRIS SUMMONED"
:Pause
:ClrHome
:Output(4,4,"ROUNDHOUND KICK TO THE FACE"
:Pause
:ClrHome
:Output(4,4,"INSTANT KO"
:Pause
:ClrHome
:Output(4,4,"WINNER"
:Return
:Lbl Q
:Return
:Lbl C
:Output(4,4,"CREATED BY ALEC SZIGETI"
:Pause
:ClrHome
:Output(4,4,"CO-CREATED BY VINNY"
:Pause
:ClrHome
:Output(4,4,"SPECIAL THANKS TO CEMETECH.NET"
:Pause
:ClrHome
:Return


This is the code to my game and when I made it Mirage compatible, mirage crashed after exiting out.
:ClrHome:Lbl M:ClrHome // get rid of the first ClrHome; as stated before, you don't need it.
:Menu("MONSTOR APPEARS","ATTACK",A,"DEFEND",D," @#!*% OUT",P,"SPECIAL ATTACK",SP,"QUIT",Q,"CREDITS",C// "Monster"
:Lbl A
:Menu("WEAPONS","PUNCH",PU,"SWORD",SW,"FIRE",FI
:Lbl PU
:Output(4,4,"1 DAMAGE" //No need for closing quote
:Pause
:Goto M
:Lbl SW
:Output(4,4,"10 DAMAGE" //No need for closing quote
:Pause
:Goto M
:Lbl FI
:Output(4,4,"100 DAMAGE" //No need for closing quote
:Pause :ClrHome
:Output(4,4,"WINNER" //No need for closing quote
:Return
:Lbl D
:Menu("SHEILDS","WEAK SHEILD",WS,"MEDIUM SHEILD",MS,"STRONG SHEILD",SS
:Lbl WS
:Output(4,4,"100DAMAGE TAKEN" //No need for closing quote
:Pause :ClrHome
:Output(4,4,"YOU LOSE" //No need for closing quote
:Pause
:Return
:Lbl MS
:Output(4,4,"50 DAMAGE TAKEN" //No need for closing quote
:Pause
:Goto M
:Lbl SS
:Output(4,4,"1 DAMAGE TAKEN" //No need for closing quote
:Pause
:Goto M
:Lbl P
:Menu("SPEED","FAST",FA,"SLOW",SL
:Lbl FA
:Disp "YOU GET AWAY":Pause //You can change this line to just :Pause"YOU GET AWAY
:ClrHome
:Output(4,4," @#!*% WINNER" //No need for closing quote
:Pause
:Return
:Lbl SL
:Disp "HE EATS YOU"::Pause //You can change this line to just :Pause "HE EATS YOU
:ClrHome
:Output(4,4," @#!*% LOSER" //No need for closing quote
:Pause
:Return
:Lbl SP
:Menu("SPECIAL","GOD ALMIGHTY",GA,"CHUCK NORRIS",CN
:Lbl GA
:Output(4,4,"BOOM!" //No need for closing quote (nor this line, since the next line overwrites it anyways)
:Output(4,4,"MθNSTER GOES TO @#!*% " //No need for closing quote
:Pause :ClrHome
:Output(4,4,"WINNER" //No need for closing quote
:Pause
:Return
:Lbl CN
:Output(4,4,"CHUCK NORRIS SUMMONED" //No need for closing quote
:Pause
:ClrHome
:Output(4,4,"ROUNDHOUND KICK TO THE FACE" //No need for closing quote
:Pause
:ClrHome
:Output(4,4,"INSTANT KO" //No need for closing quote
:Pause
:ClrHome
:Output(4,4,"WINNER" //No need for closing quote
:Return
:Lbl Q
:Return
:Lbl C
:Output(4,4,"CREATED BY ALEC SZIGETI" //No need for closing quote
:Pause
:ClrHome
:Output(4,4,"CO-CREATED BY VINNY" //Why don't you just put this on another line on the screen? For example, change the corrdinates to 5,4 or something. Also, no need for closing quote
:Pause
:ClrHome
:Output(4,4,"SPECIAL THANKS TO CEMETECH.NET" //No need for closing quote
:Pause
:ClrHome
:Return//No need for Return at the end of a program



Here's a slightly optimized version of your code


:Lbl M:ClrHome
:Menu("MONSTER APPEARS","ATTACK",A,"DEFEND",D," @#!*% OUT",P,"SPECIAL ATTACK",SP,"QUIT",Q,"CREDITS",C// "Monster"
:Lbl A
:Menu("WEAPONS","PUNCH",PU,"SWORD",SW,"FIRE",FI
:Lbl DC
:ClrHome
:Output(4,4,Ans
:Return
:Lbl DI
:Output(4,4,Ans
:Pause
:Goto M

:Lbl PU
:"1 DAMAGE
:Goto DI
:Lbl SW
"10 DAMAGE
:Goto DI
:Lbl FI
:Output(4,4,"100 DAMAGE
:Pause
:"WINNER
:Goto DC
:Lbl D
:Menu("SHEILDS","WEAK SHEILD",WS,"MEDIUM SHEILD",MS,"STRONG SHEILD",SS
:Lbl WS
:Output(4,4,"100DAMAGE TAKEN
:Pause
"YOU LOSE
:Goto DC
:Lbl MS
:"50 DAMAGE TAKEN
:Goto DI
:Lbl SS
:"1 DAMAGE TAKEN
:Goto DI
:Lbl P
:Menu("SPEED","FAST",FA,"SLOW",SL
:Lbl FA
:Pause"YOU GET AWAY
:" @#!*% WINNER
:Goto DC
:Lbl SL
:Pause "HE EATS YOU
:" @#!*% LOSER
:Goto DC
:Lbl SP
:Menu("SPECIAL","GOD ALMIGHTY",GA,"CHUCK NORRIS",CN
:Lbl GA
:Output(4,4,"MθNSTER GOES TO @#!*%
:Pause
:"WINNER
:Goto DC
:Lbl CN
:Output(4,4,"CHUCK NORRIS SUMMONED
:Pause
:ClrHome
:Output(4,4,"ROUNDHOUND KICK TO THE FACE
:Pause
:ClrHome
:Output(4,4,"INSTANT KO
:Pause
:"WINNER
:Goto DC
:Lbl Q
:Return
:Lbl C
:Output(4,4,"CREATED BY ALEC SZIGETI
:Pause
:ClrHome
:Output(4,4,"CO-CREATED BY VINNY
:Pause
:ClrHome
:Output(4,4,"SPECIAL THANKS TO CEMETECH.NET
:Pause
:ClrHome
Problem is that, if I do not put closing quotes then the display gets messed up.


Also can I get some assistance with the MirageOS problem?
Nonsense. The closing quotes should have no effect on the display. They are NOT necessary.
Strange but I did some testing and there was this one line of display that had extra words from the next line until I closed the quotes but it was only for that line and one other where it did not appear at all until I closed the quotes.
qazz42 wrote:
Problem is that, if I do not put closing quotes then the display gets messed up.


Also can I get some assistance with the MirageOS problem?
You know what I'd suggest for the MirageOS problem. Wink Make it Doors CS compatible instead using the hybrid header (which is also MirageOS compatible) and use DCS instead. Very Happy Or are you waiting for the stable beta?
qazz42 wrote:
Strange but I did some testing and there was this one line of display that had extra words from the next line until I closed the quotes but it was only for that line and one other where it did not appear at all until I closed the quotes.


Are you putting multiple lines of code on the same line and separating them with colons? i.e.

Code:
instead of:

:5->A
:10->B

You do

:5->A:10->B

Because that'll do it
Yep I still need the stable beta.

I could use 6.2 but then I have to be extremely careful and alert and cannot turn off when a teacher comes near me neither of which I have the patience to do. Laughing



Yep I checked and fixed all of them like that but it still happened.


Oh and rthprog I stopped working on that it was a crap test program. Now my foucus is on my game.....
qazz42 wrote:
Oh and rthprog I stopped working on that it was a crap test program. Now my foucus is on my game.....


No problem. But before diving into game development, I would strongly recommend reading up on variables, and if you get the chance, lists.

Trust me.
Yep I am working on that now actually........
  
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