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 Previous  1, 2, 3 ... 11, 12, 13
» View previous topic :: View next topic  
Author Message
Harrierfalcon
The Raptor of Calcs


Super Elite (Last Title)


Joined: 25 Oct 2006
Posts: 2535

Posted: 30 Jun 2008 10:50:02 am    Post subject:

You don't ever want to use that in a loop where speed is critical.

:0→Z
:startTmr→X
:For(Y,0,E3
:getKey
:Z+(Ans=26)-(Ans=24→Z
:End
:Disp checkTmr(X
:0→Z
:startTmr→X
:For(Y,0,E3
:getKey
:Z+∆List(Ans={24,26→Z
:End
:Disp checkTmr(X


Test 1: Results for running that without pressing any keys:
1: 19 seconds
2: 68 seconds

Test 2: Results for running it, but going to E2 instead of E3:
1: 2 seconds
2: 7 seconds

Repeating Test 2 with me mashing the left button has no apparent effect on the speed. (I would've repeated Test 1 with mashing, but I'm not about to sit there for a minute mashing buttons)


Last edited by Guest on 30 Jul 2010 05:33:55 am; edited 1 time in total
Back to top
Weregoose
Authentic INTJ


Super Elite (Last Title)


Joined: 25 Nov 2004
Posts: 3976

Posted: 30 Jun 2008 01:23:09 pm    Post subject:

For what it's worth, is a (5-sided) symbol that represents a house, and is not included in the TI-83+ character set. A change in value—which is what [font="times new roman"]List() observes—is denoted by the Greek Capital Letter Delta ([font="times new roman"]). As always, instructions for writing all the calculator's symbols are available here.

[EDIT]

Moved posts to the appropriate topic.

Last edited by Guest on 30 Jul 2010 05:34:49 am; edited 1 time in total
Back to top
luby
I want to go back to Philmont!!


Calc Guru


Joined: 23 Apr 2006
Posts: 1477

Posted: 30 Jun 2008 05:12:25 pm    Post subject:

So, the routine would go well in a menu type scenario, no?
Back to top
Harrierfalcon
The Raptor of Calcs


Super Elite (Last Title)


Joined: 25 Oct 2006
Posts: 2535

Posted: 30 Jun 2008 06:36:36 pm    Post subject:

Goose: I fixed it. Is that better now? >_<

luby: Technically, depends on the type of menu. Realistically, yes.
Back to top
Cryzbl


Newbie


Joined: 20 Jun 2008
Posts: 46

Posted: 01 Jul 2008 03:44:19 pm    Post subject:

luby wrote:
Anybody who wants a dirty keypress optimization:

X+(K=26)-(K=24→X
17 bytes

X+⌂list(K={24,26→X
15 bytes


[url="http://tifreakware.ath.cx/index.php?showtopic=1177&st=0"]Source[/url]: darkstone knight

As for speed... I haven't checked yet. I'd guess the bigger one by a tiny bit.
[post="124924"]<{POST_SNAPBACK}>[/post]


Well I guess you could make a list of possible values for K and do this:
X+L1(K→X

Not really smaller (since you need to initialize L1 plus the size of L1) but it would be very fast.
You may want to modify K before doing that though (to shrink the size of L1)


Last edited by Guest on 30 Jul 2010 05:35:24 am; edited 1 time in total
Back to top
TheStorm


Calc Guru


Joined: 17 Apr 2007
Posts: 1233

Posted: 01 Jul 2008 04:20:33 pm    Post subject:

That's a good idea but the size of the list makes it impractical to use. the list would need 105 elements though you could use a formula to shrink it down but then the other methods are faster. Though if you are doing a lot of test like this you could use one list for all of you tests and if someone used a formula to generate the list you might be able to make up the size difference caused by the large list.
Back to top
Cryzbl


Newbie


Joined: 20 Jun 2008
Posts: 46

Posted: 01 Jul 2008 07:45:25 pm    Post subject:

Not really :P

DelVar L1105→dim(L1
-1→L1(keyleft
1→L1(keyright


You'll need multiple lists for up/down left/right but one could make them in the same list using complex numbers.

Also, how could other methods be faster?

EDIT:
On a side note, could this forumula be used to shrink the size?
K-4int(log(K
Or something along those lines.

[offtopic]
Quote:
Lisp
Learning it
-may switch to python because no one I know knows lisp.

I do. Very Happy
[/offtopic]


Last edited by Guest on 30 Jul 2010 05:35:50 am; edited 1 time in total
Back to top
luby
I want to go back to Philmont!!


Calc Guru


Joined: 23 Apr 2006
Posts: 1477

Posted: 01 Jul 2008 09:16:45 pm    Post subject:

I don't think you understand what TheStorm is saying. The ∆List() command takes up more clock cycles (CPU time) then the alternative individual checking.
So, it would take 105 keypresses to check for (there's not even that many keys) for the ∆List() to be faster then hard coding, which makes the use of the routine (to add/subtract one) moot anyway because it was designed for two keypresses.
Understand?


Last edited by Guest on 30 Jul 2010 05:32:50 am; edited 1 time in total
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 Previous  1, 2, 3 ... 11, 12, 13
» View previous topic :: View next topic  
Page 13 of 13 » All times are UTC - 5 Hours

 

Advertisement