Before I get started, this is a TI-83+ OS 1.19 ROM running on jsTIfied.

Quote:

ClrDraw
// Declare vars
44→A
20→B
0→K
// Draw box
Line(7,5,7,86
Line(57,5,57,86
Line(7,5,57,5
Line(7,86,57,86
// Game loop
While K≠45
getKey→K
// Left
If K=24 and A>6
Then
A-1→A
End
// Up
If K=25 and B<85
Then
B-1→B
End
If K=26 and A<56
Then
A+1→A
End
Text(B,A,"+"
End


When I move up and left, the cursor seems to leave no trail. But when I go right....

http://imgur.com/Kk1p8

...That happens.


Is this some random bug with the OS or am I doing something wrong?


NOTE: This program was tested on an actual calc as well, so it can't be jsTIfied causing the glitch.
You're not erasing the previous "+" character before you print another one. The small font "+" character has one column of blank pixels on the right side, so every time you move it left by one pixel that one column automatically erases the previous character.

Try adding/subtracting larger values (try something like 10) from A and B and you'll see what happens.
Ah! See, that was the problem that I originally thought was the cause of it, but I became confused because it only happened when I went right. Your explanation, ahem, explains it. Thanks.
You can do a couple of things with your code there:

1 - Right after the getKey->K, add If K:Text(B,A," " (three spaces). This will clear out the cursor no matter what button is pressed.

2 - If you are using an If statement, and that conditional only executes one command, like A-1->A, you don't need a Then or End.
Thanks for the tip. I'll modify my code accordingly.
  
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