Just me writing out random basic code, seeing what works, getting feedback on how to make things better, etc.


Getkey program to see values of keys in BASIC.


Code:
ClrGraph
1->W
While W=1
Getkey->K
If K>1:Then
Text 21,21,"    "
Text 21,21,K
IfEnd
If K=47:Then
2->W
While W=2
Getkey
If Ans
Then
0->W
IfEnd
WhileEnd
ClrText
IfEnd
WhileEnd
For those of us who type up a Getkey program every time they need one, here is a short one:
Code:
For -999->K To 0:Next
While Not K
Getkey->K
WhileEnd
K
The For loop at the beginning is to make sure that you don't have a key down (the -999 part is because it fits nicely one that line).
This code moves the A around the screen.

BASIC Code wrote:
:ClrGraph
:1->W
:25->A
:25->B
:While W=1
:Text B,A,"A"
:Getkey->K
:If K
:Then
:Text B,A," " ; (4 spaces)
:IfEnd
:If K=47
:Then
:0->W
:IfEnd
:A-5((K=38 And A>5)-(K=27 And A<350->A
:B-5((K=28 And B>5)-)K=37 And B<175->B
:WhileEnd
Generated by SourceCoder, © 2005-2011 Cemetech
Optimized!
Code:
:ClrGraph
:1->W
:25->A~B
:While W=1
:Text B,A,"A"
:Getkey->K
:K=>Text B,A," " ; (4 spaces)
:K=47=>0->W
:A-5((K=38 And A>5)-(K=27 And A<350->A
:B-5((K=28 And B>5)-)K=37 And B<175->B
:WhileEnd
(It was begging someone to use the amazing => operator Very Happy)
Yes, I'm quite fond of that operator. Very Happy Very nice, and good topic idea, tifreak8x.
Heh, is nothing, just trying to learn a bit about this calculator :p
  
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