Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's TI-BASIC subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. TI-Basic => TI-BASIC
United-TI Archives -> TI-Basic
 
    » Goto page 1, 2  Next
» View previous topic :: View next topic  
Author Message
Alex


Newbie


Joined: 25 Feb 2004
Posts: 29

Posted: 02 Mar 2004 06:19:42 pm    Post subject:

Ok, i'm just wondering if you use the command pause, can you set it for how long it pauses, or you just have to push enter to get it going again. I tried
Code:
:pause 3
but it didn't work that way.. so is there any way to do it?

-Alex Laughing
Back to top
Jedd
1980 Pong World Champion


Elite


Joined: 18 Nov 2003
Posts: 823

Posted: 02 Mar 2004 06:30:44 pm    Post subject:

Yes, well, sorta. Here's how you do it in Basic:

0->A
Repeat (getkey=105)+(A=100
A+1->A
End

When I use -> I mean the [STO] key. Change the number 100 to adjust how long you want it to pause for.
Back to top
Alex


Newbie


Joined: 25 Feb 2004
Posts: 29

Posted: 02 Mar 2004 06:40:18 pm    Post subject:

k, thanks! im working out the battle system for my game, and I dont want people to have to hit enter every time someone attacks lol.. thanks.. and the A is a variable, right?
Back to top
Awesome1


Advanced Member


Joined: 28 Jan 2004
Posts: 269

Posted: 02 Mar 2004 06:50:26 pm    Post subject:

Im not the origional poster but yes thats correct. There are 27 variables:
ABCDEFGHIJKLMNOPQRSTUVWXYZ AND 0 Number 3 on the number pad


Last edited by Guest on 02 Mar 2004 06:51:50 pm; edited 1 time in total
Back to top
Alex


Newbie


Joined: 25 Feb 2004
Posts: 29

Posted: 02 Mar 2004 06:55:07 pm    Post subject:

yes, i know how to use variables and lists.. i made a little script with variables, like a bank, where you can check how much money you have, deposit money, and withdraw money.. its a simple script, but it took a while to get the output x and y right lol... i used that to show the amount of money you have.
Back to top
Jedd
1980 Pong World Champion


Elite


Joined: 18 Nov 2003
Posts: 823

Posted: 02 Mar 2004 06:56:26 pm    Post subject:

Alex wrote:
k, thanks! im working out the battle system for my game, and I dont want people to have to hit enter every time someone attacks lol.. thanks..  and the A is a variable, right?

A is the counter for the pause. If you don't want them to have to hit enter, you can change 105 (which is the number representation of [Enter]) to something else, like 21 (2ND).
Back to top
Alex


Newbie


Joined: 25 Feb 2004
Posts: 29

Posted: 02 Mar 2004 07:06:54 pm    Post subject:

so thats what getkey is lol... i knew that!
Back to top
Awesome1


Advanced Member


Joined: 28 Jan 2004
Posts: 269

Posted: 02 Mar 2004 07:57:55 pm    Post subject:

Well GetKey is a program that retreives the key value which u can have the program wait for that key being pressed.


Code:
Lbl 1
Output(8,1,"Press Y= To Quit"
0->K
While K=0
GetKey->K
If K>0
Disp K
End
While K not equal to 11           // The [Y=] button
Goto 1

one of MANY ways for a getkey program


y= to Graph (11-15)
2nd to del (22-24) right arrow(25), up arrow (26), down arrow (27)
Alpha to Down Arrow (31-35)
Math to CLEAR (41-45) and so on...

But im sure u already know that... I hope if u've been programming for a while Wink
Back to top
Alex


Newbie


Joined: 25 Feb 2004
Posts: 29

Posted: 02 Mar 2004 08:05:16 pm    Post subject:

actually im new to scripting, but i learn fast.. like i understood that script that you gave me lol
Back to top
Awesome1


Advanced Member


Joined: 28 Jan 2004
Posts: 269

Posted: 02 Mar 2004 08:26:32 pm    Post subject:

I myself and still new but i can program the basics. Like if i need to program a proggy on my calc to help me in algebra or something...

Basic is what it is. It's extremely easy to understand. If you are awesome at math it's even more easy and u can program games and such. Which im at the beginning stage of. The only confusing things at first are If Then statements.

For example:


Code:
Input "Age",A
If A<5
Goto 1
If A>100
Goto 2
End
Lbl 1
Clrhome
Output(1,1,"WOW, ur young!"
Pause
Clrhome
Stop
Lbl 2
Clrhome
Output(1,1,"WOW, ur OLD!"
Pause
Clrhome
Stop


Try it, Mess with it
U may wanna put that getkey program in ur calc, just incase...;)

Note:
I test my programs before i post them... So i know they work to avoid confusion or fustration...
Back to top
Newbie


Bandwidth Hog


Joined: 23 Jan 2004
Posts: 2247

Posted: 02 Mar 2004 09:05:07 pm    Post subject:

You could use a for loop

repeat K=#
getkey->#
For(X,1,100 (adjust one hundred, higher goes longer visa versa)
End
Getkey
Code
Back to top
Alex


Newbie


Joined: 25 Feb 2004
Posts: 29

Posted: 02 Mar 2004 09:08:01 pm    Post subject:

lol, this is what just happened to me...
i was playing around with the first script jedd gave me, and i labeled it A, and then at the end of that script I did goto A, so as you can imagine, it kept going and going and going... so not thinking, i pulled out a battery... Memory Cleared... Neutral Oh well time to re-program my game.. no big deal
Back to top
Awesome1


Advanced Member


Joined: 28 Jan 2004
Posts: 269

Posted: 02 Mar 2004 09:09:19 pm    Post subject:

Just press [ON] Button to break it...than select quit or goto.

Goto takes you to where the program was stoped...


Last edited by Guest on 02 Mar 2004 09:12:11 pm; edited 1 time in total
Back to top
Babyboy


Advanced Member


Joined: 11 Jun 2003
Posts: 499

Posted: 02 Mar 2004 09:36:10 pm    Post subject:

there are also variables used in the finance that u can use. probly why u cant delete it Razz
Back to top
Spyderbyte


Advanced Member


Joined: 29 May 2003
Posts: 372

Posted: 02 Mar 2004 10:38:00 pm    Post subject:

Awesome1 wrote:

Code:
Input "Age",A
If A<5
Goto 1
If A>100
Goto 2
End
Lbl 1
Clrhome
Output(1,1,"WOW, ur young!"
Pause
Clrhome
Stop
Lbl 2
Clrhome
Output(1,1,"WOW, ur OLD!"
Pause
Clrhome
Stop

Or you could optomize that to this:


Code:
Input "Age",A
Clrhome
If A<5
Disp "WOW, You're young!"
If A>100
Disp "WOW, You're OLD!"
Pause
Clrhome


Try to avoid labels where you can, especially in a loop. These are what tend to cause the ERR:MEM messages.

Also, if you wanted to do more than one thing is true, use and If Then End

If A<5
Then
Disp "WOW, You're young!"
Disp "Whos calc is this?"
End

Spyderbyte
Back to top
Arcane Wizard
`semi-hippie`


Super Elite (Last Title)


Joined: 02 Jun 2003
Posts: 8993

Posted: 03 Mar 2004 06:29:03 am    Post subject:

Awesome1 wrote:
AND 0 Number 3 on the number pad

Alt+Shift+L =

Quote:
You could use a for loop
repeat K=#
getkey->#
For(X,1,100 (adjust one hundred, higher goes longer visa versa)
End
Getkey
Code
That won't work very well, try this:

For(X,1,100
If getKey:100->X
End
Quote:
Or you could optomize that to this:
CODE 
Input "Age",A
Clrhome
If A<5
Disp "WOW, You're young!"
If A>100
Disp "WOW, You're OLD!"
Pause
Clrhome
Or (saves 3 bytes, if Pause is one byte) :

Input "AGE",A
ClrHome
If A<5
Pause "WOW, YOU'RE YOUNG!
If A>100
Pause "WOW, YOU'RE OLD!
ClrHome

It's kind of annoying that input doesn't store to Ans.
Back to top
Awesome1


Advanced Member


Joined: 28 Jan 2004
Posts: 269

Posted: 03 Mar 2004 04:43:46 pm    Post subject:

Ah yes... Well i noticed that i got mem erros after a while on my calc on my looping progs. You almost never leave here without learning something new... Laughing , me anyway... Smile Im not really concerned about size. Most of my progs are smaller than 1000. But function is a biggy for me. I like my program to run smooth which im learning techniques and strings that helpout the smoothness...
Back to top
X1011
10100111001


Active Member


Joined: 14 Nov 2003
Posts: 657

Posted: 03 Mar 2004 05:49:43 pm    Post subject:

You mean speed?

Quote:
Alt+Shift+L =

That doesn't work for me Neutral
Back to top
Arcane Wizard
`semi-hippie`


Super Elite (Last Title)


Joined: 02 Jun 2003
Posts: 8993

Posted: 03 Mar 2004 06:12:07 pm    Post subject:

The right alt key? Tried left ctrl + left alt + shit + L?
Back to top
X1011
10100111001


Active Member


Joined: 14 Nov 2003
Posts: 657

Posted: 03 Mar 2004 09:07:35 pm    Post subject:

Hm...I can't find the "shit" key, lol :lol:

But I have ctrl+alt+L set to log off, so i'm not gonna try testing it yet.
Back to top
Display posts from previous:   
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
    » Goto page 1, 2  Next
» View previous topic :: View next topic  
Page 1 of 2 » All times are GMT - 5 Hours

 

Advertisement