qazz, where is your Lbl 1, and instead of Repeat something=something, just do Repeat 1.
ugh, crap, I forgot about that other part.. >.<

I totally cant think straight when half asleep
Actually, that would only let it loop once. You need "While 1" or, if you insist on using Repeat, "Repeat 0"
Oh, right right. Forgot about that. Good catch.
calcdude84se wrote:
Actually, that would only let it loop once. You need "While 1" or, if you insist on using Repeat, "Repeat 0"
I still like having an escape condition, namely something like "Repeat K=45". In that case I avoid While so that I don't need to initialize K.
Yeah, forgot to mention that. That Repeat checks its condition only after the initial execution can be useful.
As an example, this program does not give an error.

Code:
Repeat +
Return
Nice catch calcdude! I never noticed that Smile
wow guys see im lost in the 'repeats' and 'whiles' all i know is Lbl and Goto. i think im getting it. and no, i didnt want someone to re-do everything for me, i just was asking for little tidbits on how to make the landing pads, scoring, etc.
rcplanegy wrote:
wow guys see im lost in the 'repeats' and 'whiles' all i know is Lbl and Goto. i think im getting it. and no, i didnt want someone to re-do everything for me, i just was asking for little tidbits on how to make the landing pads, scoring, etc.
Take a look at these pages:

While: http://cemetech.net/projects/btutor/btutor.php#13WR
Repeat: http://cemetech.net/projects/btutor/btutor.php#32R
For: http://cemetech.net/projects/btutor/btutor.php#14FL
so to sum it up: Nevar use a goto to make a loop

oh, and for mem errors here is some code to demonstrate it



Code:

lbl 1
a = 0
If a= 0
Then
Goto 1
end


correct me if I am wrong >.>

Code:
Lbl 1
0->A
If A=0
Goto 1


Smile
I'll correct you! Very Happy

*Never.
_player1537 wrote:

Code:
Lbl 1
0->A
If A=0
Goto 1


Smile


yeah, but since there is no "then" wont there be no mem err?
_player1537 wrote:

Code:
Lbl 1
0->A
If A=0
Goto 1


Smile

That's not a memory leak; you need a Then

Code:
Lbl 0
If 1
Then
Goto 0
End

Edit: ninja'd, but I included fixed code
_player1537 wrote:

Code:
Lbl 1
0->A
If A=0
Goto 1


Smile
As calcdude pointed out, that's the example of how to avoid a memory leak with Goto. Wink
Does this work yet? Because it's honestly one of the best uses of limited calculator hardware I've ever heard of...
qazz42 wrote:
yeah, but since there is no "then" wont there be no mem err?

Quote:
Yeah, but since there is no "then" there wont be mem err.
is it really? i wanted a relativly simple, yet interesting game... ill get the code that qazz posted and fix it up
Yeah. Lunar lander is one of both mine and my dad's favorite games, and if I had a working TI graphing Calculator I'd totally get this for it.
MufinMcFlufin wrote:
qazz, you didn't actually change any code.

This is what an optimization looks like:

Code:

:0→Xmin
:1→ΔX
:0→Ymin
:1→ΔY
:E2→F
:31→D
:Ans→E
:47→O
:Ans→P
:DelVar HDelvar VClrDraw
:Repeat D≤.5
:Text(0,1,"FUEL: ",F,"   
:Pt-Off(P,E+1,3
:Pt-Off(P,E,2
:Pt-On(O,D+2
:Pt-On(O,D,2
:Pt-Off(O,D-1,3
:Horizontal(0
:getKey→G
:D→E
:O→P
:If F and max(G={24,25,26,34
:Then
:H-2(G=34)+2(G=25→H
:V+2(G=26)-2(G=24→V
:F-1→F
:End
:H-1→H
:D+HE‾2→D
:O+VE‾2→O
:End
:Pt-Off(O,2,2
:Pt-Off(O,3,2
:40≥√(H2+V2
:Pt-On(O,1,3-Ans
:Pt-On(O,2+Ans
:Text(6,1,sub("CRASHED!SAFE!",1+8Ans,8-3Ans
:Pause

Haven't added anything that wasn't already in the game, but it's smaller now, and has safe/crashed landing.


hey this helps alot... but how do i get it to go ticonnect and onto my calc? Question
  
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 3
» 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