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 Technology & Calculator Open Topic 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. Calculator Tech Support => Technology & Calculator Open Topic
Author Message
wariofart


Newbie


Joined: 28 Jan 2008
Posts: 17

Posted: 28 Jan 2008 05:48:50 pm    Post subject:

I'm trying to make a game called FastKey.

but all it does is blink "PressUp"

Heres some sample code: (Bold text is not part of the program)

:Lbl DC
:ipart(1+(rand*60))->C
:If C=1
:Goto Up
:
:Lbl Up
:For(B,1,200
:Output(2,2,"Press Up
: If A(getkey variable)=25
:Goto DC
:If A<0
:Goto En(End screen)
:End
:Goto En

Please help!!!

Edit: Changed program code and changed problem!


Last edited by Guest on 28 Jan 2008 06:14:57 pm; edited 1 time in total
Back to top
JoostinOnline


Active Member


Joined: 22 Aug 2007
Posts: 559

Posted: 28 Jan 2008 05:52:33 pm    Post subject:

My guess is that you don't have any End commands in there, so if C=/=1, then it skips the whole program.

Last edited by Guest on 30 Aug 2010 08:10:04 pm; edited 1 time in total
Back to top
wariofart


Newbie


Joined: 28 Jan 2008
Posts: 17

Posted: 28 Jan 2008 05:53:54 pm    Post subject:

Where should I add the End??
Back to top
Super Speler
Super Awesome Dude


Calc Guru


Joined: 28 Nov 2005
Posts: 1391

Posted: 28 Jan 2008 06:04:58 pm    Post subject:

You shouldn't, you should delete the Then. Goto'ing outside of statements that use End causes 'Memory Leaks.' If statements that are less then one line do not require Then's
Back to top
wariofart


Newbie


Joined: 28 Jan 2008
Posts: 17

Posted: 28 Jan 2008 06:11:14 pm    Post subject:

I deleted all the thens, so now it just blinks "Press Up"
Back to top
luby
I want to go back to Philmont!!


Calc Guru


Joined: 23 Apr 2006
Posts: 1477

Posted: 28 Jan 2008 09:36:16 pm    Post subject:

:Lbl DC
:ipart(1+(rand*60))->C
:If C=1
:Goto Up
:
:Lbl Up


This right here looks questionable. No matter what C is, it looks like it will go to Up. You might want to add in If C=2: Goto Dn(down), or something.


Last edited by Guest on 30 Aug 2010 08:09:51 pm; edited 1 time in total
Back to top
JoostinOnline


Active Member


Joined: 22 Aug 2007
Posts: 559

Posted: 29 Jan 2008 11:25:03 pm    Post subject:

Yeah, I wondered about that too. I just figured that the space was a spot where more code went.
Back to top
Ph34r_my_l33t_skillz


Advanced Member


Joined: 09 Oct 2007
Posts: 339

Posted: 30 Jan 2008 11:10:39 am    Post subject:

It may be better to use RandInt( to get the random number.
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
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement