Kerm's code has no labels.
Will_W wrote:
Kerm's code has no labels.
Qazz, I'd be happy to explain how my code works line-by-line if you find it confusing.
that would be nice, thanks....
sorry if i caused trouble, i guess being at school makes me hot-headed
sorry if i caused trouble, i guess being at school makes me hot-headed
also, I don't see the point of the "then/end" parts of the code, but those can be ommited if it was in a while/repeat loop, or if you put an end parenthesis after the for( loop.
*points player off to page 1 and at mine and Kerm's code posts :p
qazz: http://tifreakware.net/tutorials/83p/b/tifw/les6.htm
Read through this first, tell us what you don't understand of that before we go further, alright?
qazz: http://tifreakware.net/tutorials/83p/b/tifw/les6.htm
Read through this first, tell us what you don't understand of that before we go further, alright?
they are pretty easy
while(condition):code:End
while checks at the beggining, ie
Code:
will never pause because it checks at the beggining
Repeat(Condition):code:End
repeat checks at the end, and loops if the condition is not true
Code:
will pause once, because it checks at the end
Does that make sense?
while(condition):code:End
while checks at the beggining, ie
Code:
0-->X:while X:pause:End
will never pause because it checks at the beggining
Repeat(Condition):code:End
repeat checks at the end, and loops if the condition is not true
Code:
3-->X:Repeat X:pause:End
will pause once, because it checks at the end
Does that make sense?
qazz42 wrote:
that would be nice, thanks....[...]
Code:
:8->X:4->Y
Code:
:Repeat K=21
Code:
:Output(Y,X,"X
Code:
:Repeat K:getKey->K:End
Code:
:Output(Y,X,"[space]
Code:
:X+(X<16)(K=26)-(X>1)(K=24->X
Code:
:Y-(Y>1)(K=25)+(Y<8)(K=34->Y
Code:
:End
tifreak8x wrote:
*points player off to page 1 and at mine and Kerm's code posts :p
qazz: http://tifreakware.net/tutorials/83p/b/tifw/les6.htm
Read through this first, tell us what you don't understand of that before we go further, alright?
qazz: http://tifreakware.net/tutorials/83p/b/tifw/les6.htm
Read through this first, tell us what you don't understand of that before we go further, alright?
Sigh.. already reading that.............. let me finish it first.
- KermMartian
- Site Admin (Posts: 64067)
- 21 May 2010 02:49:59 pm
- Last edited by KermMartian on 21 May 2010 02:52:57 pm; edited 1 time in total
_player1537 wrote:
I think that's gonna confuse him more than explain anything at this point. Did that user on Omnimaga really have to explain what the ClrHome statement does? O_o
if he didn't include how the clrhome statement worked, he would have skipped a portion of the code, and it might be somewhat confusing, idk. But it would be useful to someone who has just started ti-basic, which I think is what he was doing. either way.
Edit: Btw, that wasn't meant to be rude at all, if anyone took it that way.
Edit: Btw, that wasn't meant to be rude at all, if anyone took it that way.
hmmm....
Using the same format I was using, can anyone create a code for me that makes the X shoot ^?
Using the same format I was using, can anyone create a code for me that makes the X shoot ^?
Code:
:0-->C
:0-->D
:8→A
:8→B
:For(T,1,200000 \\you really should change this to "While K=/=45" or "Repeat K=45", those will quit when you press clear
:ClrHome
:Output(A,B,"X
:getKey→K
:If D=/=0
:Output(D,C,"^"
:D-1-->D
:End
:
:If (K=21) And (A=/=1)
:Then
:X-->C
:Y-->D
:End
:If K=26
:Then
:B+1→B
:End
:If K=24
:Then
:B-1→B
:End
:If K=25
:Then
:A-1→A
:End
:If K=34
:Then
:A+1→A
:If A>8
:1→A
:End
:If A<1
:Then
:8→A
:End
:End
I didn't test this, but it should work, I'll explain it if you need it. Keep in mind D is the Y of the bullet, and C is the X of the bullet.
yo anyone know why i get a domain error in this program?
Code:
Code:
:DelVar CDelVar D8→A
:8→B
:Repeat K=45
:ClrHome
:Output(A,B,"X
:getKey→K
:If not(D
:Then
:Output(D,C,"^
:D-1→D
:End
:If (K=21) and (A≠1
:Then
:B→C
:A→D
:End
:B+(K=26)1→B
:B-(K=24)1→B
:A-(K=25)1→A
:Then
:A+1→A
:If A>8
:1→8
:End
:If A<1
:8→A
:End
-
qazz42
- Vampire Killer (Posts: 4253)
- 21 May 2010 06:12:55 pm
- Last edited by qazz42 on 21 May 2010 07:12:05 pm; edited 1 time in total
Code:
:Output(D,C,"^
:D-1→D
right around there
qazz42 wrote:
:Output(D,C,"^
-1→D
right around there
Because If not(D detects when D is zero. You then are doing the equivalent of Output(0,C,"^, but 0 is an invalid row. The row must be between 1 and 8, inclusive.
-1→D
right around there
OK, you're using D as both the flag for the shot, and the position. Therefore, you need to change the If not(D to If D.
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
» Go to Registration page
» Goto page Previous 1, 2, 3 Next
» View previous topic :: View next topic
» View previous topic :: View next topic
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
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