<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wikidot="http://www.wikidot.com/rss-namespace">

	<channel>
		<title>new (faster) getkey</title>
		<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey</link>
		<description>Posts in the discussion thread &quot;new (faster) getkey&quot; - ITS ARRIVED :D :D :D</description>
				<copyright></copyright>
		<lastBuildDate>Sat, 08 Aug 2026 12:58:00 +0000</lastBuildDate>
		
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-542821</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-542821</link>
				<description></description>
				<pubDate>Fri, 24 Jul 2009 02:08:11 +0000</pubDate>
				<wikidot:authorName>builderboy</wikidot:authorName>				<wikidot:authorUserId>141501</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <div class="code"> <pre><code>One note: it makes little sense to optimize for speed when you have a loop that waits for a key. In that case, it's better to optimize for size.</code></pre></div> <p>exactly, so simply optimize for size and your golden! :)</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-542750</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-542750</link>
				<description></description>
				<pubDate>Fri, 24 Jul 2009 00:02:52 +0000</pubDate>
				<wikidot:authorName>_Abe_</wikidot:authorName>				<wikidot:authorUserId>341442</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>That's probably the fastest way to do it, but, like you said, the fact that it checks for irrelevant keys is inconvenient and can be speed-costly, abusable, or glitchy in some cases (e.g., missing a button and slowing down the game)</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-542746</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-542746</link>
				<description></description>
				<pubDate>Thu, 23 Jul 2009 23:54:11 +0000</pubDate>
				<wikidot:authorName>DarkerLine</wikidot:authorName>				<wikidot:authorUserId>961</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>One note: it makes little sense to optimize for speed when you have a loop that waits for a key. In that case, it's better to optimize for size.</p> <p>I like to go with</p> <div class="code"> <pre><code>:Repeat Ans :getKey→K :End</code></pre></div> <br /> even if, later on, I'm only going to accept certain keys. Even if this makes something onscreen blink every time I press an absolutely unrelated key (I figure that's not too important, plus it lets the user know the program noticed the keypress)
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-542741</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-542741</link>
				<description></description>
				<pubDate>Thu, 23 Jul 2009 23:50:06 +0000</pubDate>
				<wikidot:authorName>_Abe_</wikidot:authorName>				<wikidot:authorUserId>341442</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Bearing in mind that not(while loop) is pretty much the same as repeat and that end parenthesis and brackets can be left off,<br /> I recommend:</p> <p>repeat sum(K={24,25,26,34<br /> getkey→K<br /> end</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-542476</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-542476</link>
				<description></description>
				<pubDate>Thu, 23 Jul 2009 18:28:00 +0000</pubDate>
				<wikidot:authorName>Matthias1992</wikidot:authorName>				<wikidot:authorUserId>310020</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>how about this routine?</p> <div class="code"> <pre><code>while k≠24 and k≠25 and K≠26 and k≠34 getkey→ k end</code></pre></div> <p>or</p> <div class="code"> <pre><code>while not(sum({24,25,26,34}=k)) getkey→ K end</code></pre></div> <p>i use those al the time, all the approachs above don't seem any more fast to me than the ones i just gave you. Perhaps i am wrong, we'll find out soon enough.</p> <p>EDIT: i realize this is a nearly forgotten topic but i was just wandering around the site and came across this so&#8230;</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-303781</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-303781</link>
				<description></description>
				<pubDate>Sun, 09 Nov 2008 02:59:16 +0000</pubDate>
				<wikidot:authorName>symaxian</wikidot:authorName>				<wikidot:authorUserId>33531</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Ah, true forgot about that, might have to incorporate it after I get all the other getkey calls done.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-303775</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-303775</link>
				<description></description>
				<pubDate>Sun, 09 Nov 2008 02:48:00 +0000</pubDate>
				<wikidot:authorName>simplethinker</wikidot:authorName>				<wikidot:authorUserId>31581</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>A 34 element list will take up 318 bytes of memory. You could cut 414 bytes (207 for each list) out with</p> <div class="code"> <pre><code>SetUpEditor L1 SetUpEditor L2 DelVar L1 DelVar L2 11→dim(L1 11→dim(L2 -1→L1(1 1→L2(2 1→L1(3 -1→L2(11 Repeat K=22 getKey-23→K If max(K={1,2,3,11 Then X+L1(K)→X Y+L2(K)→Y End End</code></pre></div> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-303761</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-303761</link>
				<description></description>
				<pubDate>Sun, 09 Nov 2008 02:22:43 +0000</pubDate>
				<wikidot:authorName>symaxian</wikidot:authorName>				<wikidot:authorUserId>33531</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Just speaking of alternate getKey's for movement Im using this for a loop of mine.</p> <div class="code"> <pre><code>SetUpEditor L1 SetUpEditor L2 DelVar L1 DelVar L2 34→dim(L1 34→dim(L2 -1→L1(24 1→L2(25 1→L1(26 -1→L2(34 Repeat K=45 getKey→K If max(K={24,25,26,34 Then X+L1(K)→X Y+L2(K)→Y End End</code></pre></div> <p>Thats it, very shortened.<br /> This isnt the fastest by itself but useful for an extensive game.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-291632</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-291632</link>
				<description></description>
				<pubDate>Sat, 25 Oct 2008 08:27:00 +0000</pubDate>
				<wikidot:authorName>darkstone knight</wikidot:authorName>				<wikidot:authorUserId>141837</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>yep</p> <p>try downloading xsnake from ticalc.org</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-291526</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-291526</link>
				<description></description>
				<pubDate>Sat, 25 Oct 2008 05:05:42 +0000</pubDate>
				<wikidot:authorName>architeuthiskid</wikidot:authorName>				<wikidot:authorUserId>168420</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Use a seperate loop for each direction.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-291371</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-291371</link>
				<description></description>
				<pubDate>Fri, 24 Oct 2008 23:14:05 +0000</pubDate>
				<wikidot:authorName>ninjabob7</wikidot:authorName>				<wikidot:authorUserId>163348</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>So what's the fastest way to handle movement on the home screen? In my game, you can't stop moving and you bounce off the edge of the screen. Speed is more important than size.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-231696</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-231696</link>
				<description></description>
				<pubDate>Thu, 31 Jul 2008 21:52:42 +0000</pubDate>
				<wikidot:authorName>DarkerLine</wikidot:authorName>				<wikidot:authorUserId>961</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>That's something you could do for any routine, though, so it's not really an improvement in any specific case.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-231691</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-231691</link>
				<description></description>
				<pubDate>Thu, 31 Jul 2008 21:40:49 +0000</pubDate>
				<wikidot:authorName>architeuthiskid</wikidot:authorName>				<wikidot:authorUserId>168420</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I just thought of this, but if you replaced the Letter variables with the finance variables, you<br /> could speed it up even more, since the finance variables are faster than even Ans.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-198759</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-198759</link>
				<description></description>
				<pubDate>Tue, 17 Jun 2008 15:03:39 +0000</pubDate>
				<wikidot:authorName>darkstone knight</wikidot:authorName>				<wikidot:authorUserId>141837</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>about 5 months ^^</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-198724</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-198724</link>
				<description></description>
				<pubDate>Tue, 17 Jun 2008 14:31:17 +0000</pubDate>
				<wikidot:authorName>basickevin</wikidot:authorName>				<wikidot:authorUserId>114819</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>sorry&#8230;..:D</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-198491</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-198491</link>
				<description></description>
				<pubDate>Tue, 17 Jun 2008 11:23:28 +0000</pubDate>
				<wikidot:authorName>Mapar007</wikidot:authorName>				<wikidot:authorUserId>143829</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>WOW darkstone knight? How long have you been programming TI-basic? I saw you are only a member of this wiki since 6 days ago? Or do you have more experience?</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-197701</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-197701</link>
				<description></description>
				<pubDate>Mon, 16 Jun 2008 20:27:05 +0000</pubDate>
				<wikidot:authorName>darkstone knight</wikidot:authorName>				<wikidot:authorUserId>141837</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>damn, you liar<br /> :D</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-197485</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-197485</link>
				<description></description>
				<pubDate>Mon, 16 Jun 2008 17:35:51 +0000</pubDate>
				<wikidot:authorName>basickevin</wikidot:authorName>				<wikidot:authorUserId>114819</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>sorry guys. I forgot about the scientific method there for a second and changed more than just the routine. the actual timings are 103 pixels for the ipart/fpart method and 104 for the original. I'm not so sure one pixel faster over 200 iterations, which turns out to be about 1/500th of a second per iteration, is worth 14 bytes of size. I accidentally used a alternate display method I devised, which turns out to be quite slow, in only one of the routines.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-197396</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-197396</link>
				<description></description>
				<pubDate>Mon, 16 Jun 2008 16:33:05 +0000</pubDate>
				<wikidot:authorName>darkstone knight</wikidot:authorName>				<wikidot:authorUserId>141837</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>seems my routine is even faster than i thougth<br /> yay</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-197387</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-197387</link>
				<description></description>
				<pubDate>Mon, 16 Jun 2008 16:25:33 +0000</pubDate>
				<wikidot:authorName>burr</wikidot:authorName>				<wikidot:authorUserId>740</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>It would definitely be good to document these findings.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-197368</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-197368</link>
				<description></description>
				<pubDate>Mon, 16 Jun 2008 16:05:17 +0000</pubDate>
				<wikidot:authorName>basickevin</wikidot:authorName>				<wikidot:authorUserId>114819</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Ok, so lets recap. The alternate routine for graphscreen movement with one variable and ipart/fpart is much faster but larger, and you can use △list(K={24,26 to make your code smaller, but then setting boundaries is no longer possible without making the code larger again. (has anyone other than me noticed that?)<br /> To be exact, I implemented the alternate routine onto the homescreen (yah, it took a while to figure things out), and the alternate routine was this fast at a for loop with 200 iterations. 12 bars, seven pixels, or 103 pixels. the original routine is 16 bars, 5 five pixels, or 133 pixels. that's 23% faster. I'll post these timings on the code timings page for reference.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-196365</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-196365</link>
				<description></description>
				<pubDate>Sun, 15 Jun 2008 19:26:21 +0000</pubDate>
				<wikidot:authorName>darkstone knight</wikidot:authorName>				<wikidot:authorUserId>141837</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>yes, but large lists are faster than multiple and/or commands</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-196356</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-196356</link>
				<description></description>
				<pubDate>Sun, 15 Jun 2008 19:20:53 +0000</pubDate>
				<wikidot:authorName>Edward H</wikidot:authorName>				<wikidot:authorUserId>139339</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I don't think so. If you check the timings page, I believe implied multiplication is actually faster than explicit multiplication, and unclosed parentheses take the same amount of time as normal parentheses. You're right about the lists. The lists and the extra operations are the main reason its slower.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-196306</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-196306</link>
				<description></description>
				<pubDate>Sun, 15 Jun 2008 18:32:09 +0000</pubDate>
				<wikidot:authorName>basickevin</wikidot:authorName>				<wikidot:authorUserId>114819</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>The reason that it is slower is that the less things you make the calculator imply (brackets/parenthesis, multiplication, etc.) the less work it has to do. because △list(K={24,26 uses lists and involves more overall operations than the common formula, it is slower.<br /> posted to the DYK page also.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-196239</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-196239</link>
				<description></description>
				<pubDate>Sun, 15 Jun 2008 17:51:10 +0000</pubDate>
				<wikidot:authorName>darkstone knight</wikidot:authorName>				<wikidot:authorUserId>141837</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>yep</p> <p>should be included in the &quot;did you know&quot; page</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-196230</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-196230</link>
				<description></description>
				<pubDate>Sun, 15 Jun 2008 17:41:11 +0000</pubDate>
				<wikidot:authorName>basickevin</wikidot:authorName>				<wikidot:authorUserId>114819</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Actually, since user created menus don't need much speed, that would be a good application for it.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-196177</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-196177</link>
				<description></description>
				<pubDate>Sun, 15 Jun 2008 16:46:05 +0000</pubDate>
				<wikidot:authorName>darkstone knight</wikidot:authorName>				<wikidot:authorUserId>141837</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>it might be usefull in those games that dont require speed</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-196005</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-196005</link>
				<description></description>
				<pubDate>Sun, 15 Jun 2008 12:41:07 +0000</pubDate>
				<wikidot:authorName>burr</wikidot:authorName>				<wikidot:authorUserId>740</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>That was a good thought, though.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-195944</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-195944</link>
				<description></description>
				<pubDate>Sun, 15 Jun 2008 10:23:04 +0000</pubDate>
				<wikidot:authorName>darkstone knight</wikidot:authorName>				<wikidot:authorUserId>141837</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>OMFG cant belive this<br /> X+(K=26)-(K=24→X<br /> 16 bytes</p> <p>X+△list(K={24,26→X<br /> <span style="text-decoration: line-through;">13 bytes?</span><br /> 14 bytes, △list is 2 bytes</p> <p>revolution starts in: 0 seconds<br /> :D</p> <p>edit: actualy its slower LOL</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-195912</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-195912</link>
				<description></description>
				<pubDate>Sun, 15 Jun 2008 09:31:01 +0000</pubDate>
				<wikidot:authorName>GoVegan</wikidot:authorName>				<wikidot:authorUserId>35113</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Okey Dokey, I was able to shrink your routine after all. Look,</p> <div style="float:left;"> <blockquote> <p>Instead of this:<br /> :A+(K=26)-(K=24)+.001((K=25)-(K=34→A</p> <p>You can do this:<br /> :A+(K=26)-(K=24)+<span style="font-size:75%;">E</span>‾3((K=25)-(K=34→A</p> </blockquote> </div> <div style="clear:both; height: 0px; font-size: 1px"></div> <p>By using that really cool <span style="font-size:75%;"><a href="http://tibasicdev.wikidot.com/e-ten">E</a></span>, you will save a glorious byte.</p> <p><strong><em>Cheers ~ James Kanjo</em></strong></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-195530</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-195530</link>
				<description></description>
				<pubDate>Sat, 14 Jun 2008 21:11:26 +0000</pubDate>
				<wikidot:authorName>darkstone knight</wikidot:authorName>				<wikidot:authorUserId>141837</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>thanks</p> <p>now we need to wait for programers that are clever enoufh to (correctly) use this new routine</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-195524</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-195524</link>
				<description></description>
				<pubDate>Sat, 14 Jun 2008 21:06:25 +0000</pubDate>
				<wikidot:authorName>basickevin</wikidot:authorName>				<wikidot:authorUserId>114819</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>reply to your edit: notice I did use Ans, it's just that you can't use it as much if you want your routine to actually work on the right boundary. The routines I suggested were designed to work in all situations and be as small as possible.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-195517</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-195517</link>
				<description></description>
				<pubDate>Sat, 14 Jun 2008 21:02:00 +0000</pubDate>
				<wikidot:authorName>basickevin</wikidot:authorName>				<wikidot:authorUserId>114819</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>for the first thing, I optimize for size, so I don't do that crazy negative thing that makes text coordinates the same as regular ones. It's slower and larger and hard to understand.<br /> for the second, the problem isn't necessarily the last row. It's the last pixel to the right of the screen that the user is aloud to move onto. Thus, a boundary of A&lt;X means the Xth column of pixels doesn't work. So something will always have a bug in it with your better optimization.<br /> for the thing where using lists might optimize it more, things are only slightly better. I made a version of Daleks (look at the forum page for it) with 1 list instead of two and it was 25 bytes larger and a tad bit slower. you could argue that because of the list (minimum 57 bytes) being gone it's actually smaller, but that's not permanent size, that's size during the game. I think with lists which method is better is determined by how large the lists are and how often they are used.<br /> Overall, I say that your method works well in situations with lots of lists full of coordinates and is a bit counterintuitive in normal getkey situations. Thanks for all the suggestions on it though.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-195479</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-195479</link>
				<description></description>
				<pubDate>Sat, 14 Jun 2008 20:35:24 +0000</pubDate>
				<wikidot:authorName>darkstone knight</wikidot:authorName>				<wikidot:authorUserId>141837</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p><sub><sup>2: I made a new getkey program with the idea, except that I realized something. because the calculator considers X.Y to be outside the screen when X=94 and Y is nonzero with a boundary of X&lt;94, the last row will never be displayed with the optimized Pt-on(A,fpart(A. It must be Pt-on(ipart(A),fpart(A for it to work correctly on the outer boundary. Thus, it is of no use to add the extra zero on the screen dimensions for the Y coordinate.</sup></sub><br /> you are correct, never releazed that<br /> how about a window setting of 0,-.062?</p> <p>also, if you ignore the last pixel (that is rarely used in most games, except for line( commands)<br /> the routine can be smaller</p> <div class="code"> <pre><code>GridOff AxesOff FnOff PlotsOff 0→Xmin 1→ΔX 0→Ymin 1%→ΔY or .62→Ymax DelVar AClrDraw Repeat 0 getKey→G fpart(A Line(A,Ans,A,Ans,not(G A+(G=26 and B&lt;94)-(G=24 and B)+(% or .01, whichever works)(G=25 and Ans&lt;.62)-(G=34 and Ans→A End</code></pre></div> <p>5 less bytes</p> <p>if you gime me a few days, i will make 2 snake games and compare the speed</p> <p>edit: notice you are not using ans, which is the major factor in its speed</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-195455</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-195455</link>
				<description></description>
				<pubDate>Sat, 14 Jun 2008 20:04:07 +0000</pubDate>
				<wikidot:authorName>basickevin</wikidot:authorName>				<wikidot:authorUserId>114819</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>1: We need to make a page about this called Alternate Getkey Routines.<br /> 2: I made a new getkey program with the idea, except that I realized something. because the calculator considers X.Y to be outside the screen when X=94 and Y is nonzero with a boundary of X&lt;94, the last row will never be displayed with the optimized Pt-on(A,fpart(A. It must be Pt-on(ipart(A),fpart(A for it to work correctly on the outer boundary. Thus, it is of no use to add the extra zero on the screen dimensions for the Y coordinate.<br /> 3: Sorry to be a party pooper, but the regular routine for movement and this alternate routine are the exact same speed over 500 iterations, 32 bars 6 pixels, or 262 pixels. The alternate routine is also larger. The reason for this is that the required fpart and ipart commands take up so much space that it is counterintuitive, because you save space by putting ipart(A and fpart(A on their own line. Thus you are actually using more variables than you were originally, and lose space.<br /> 4:how do you access the percent symbol on a calculator? it might make the alternate routine slightly better.<br /> 5: Here is what the programs look like in a complete form (regular getKey program 119 bytes)</p> <div class="code"> <pre><code>GridOff AxesOff FnOff PlotsOff 0→Xmin 1→ΔX 0→Ymin 1→ΔY DelVar ADelVar BClrDraw Repeat 0 getKey→G Line(A,B,A,B,not(Ans A+(Ans=26 and A&lt;94)-(Ans=24 and A→A B+(G=25 and B&lt;62)-(G=34 and B→B End</code></pre></div> <p>And here is the Alternate routine suggested by Darkstone Knight with some adjustments. 129 bytes.</p> <div class="code"> <pre><code>GridOff AxesOff FnOff PlotsOff 0→Xmin 1→ΔX 0→Ymin 1%→ΔY or .62→Ymax DelVar AClrDraw Repeat 0 getKey→G ipart(A→B fpart(A Line(B,Ans,B,Ans,not(G A+(G=26 and B&lt;94)-(G=24 and B)+(% or .01, whichever works)(G=25 and Ans&lt;.62)-(G=34 and Ans→A End</code></pre></div> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-194822</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-194822</link>
				<description></description>
				<pubDate>Sat, 14 Jun 2008 10:00:13 +0000</pubDate>
				<wikidot:authorName>darkstone knight</wikidot:authorName>				<wikidot:authorUserId>141837</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p><sup>Also, what if you had the window variables (0, 94, 0, .64) ? Then your code could be even smaller:</sup></p> <p>this is false, because you need to use ipart( to get the x var</p> <p>edit: nvm&#8230; wasnt paying atention</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-194799</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-194799</link>
				<description></description>
				<pubDate>Sat, 14 Jun 2008 09:27:40 +0000</pubDate>
				<wikidot:authorName>Arjen</wikidot:authorName>				<wikidot:authorUserId>142596</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>thats kinda genius.<br /> :D have you made this up your self or did you find it some where else?</p> <p>james kanjo is right, but you've just switch the up-button (25) with the down-button (34). Thats no big deal</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-194772</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-194772</link>
				<description></description>
				<pubDate>Sat, 14 Jun 2008 08:56:55 +0000</pubDate>
				<wikidot:authorName>GoVegan</wikidot:authorName>				<wikidot:authorUserId>35113</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>What do you mean by <em>no it is not</em>? Are you saying your routine is <strong><em>not</em></strong> clever?</p> <p>That is also clever how you take the X factor being rounded up into consideration!</p> <p>But did you notice the first thing I said?</p> <p><strong><em>Cheers ~ James Kanjo</em></strong></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-194707</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-194707</link>
				<description></description>
				<pubDate>Sat, 14 Jun 2008 07:44:21 +0000</pubDate>
				<wikidot:authorName>darkstone knight</wikidot:authorName>				<wikidot:authorUserId>141837</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>no it is not<br /> if x is 50.64, x rounds up<br /> so you need ipart(<br /> if you use .001, X will <span style="text-decoration: underline;">always</span> round down</p> <p>so no need to use Ipart( when getting the x coord</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-194545</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-194545</link>
				<description></description>
				<pubDate>Sat, 14 Jun 2008 02:08:23 +0000</pubDate>
				<wikidot:authorName>basickevin</wikidot:authorName>				<wikidot:authorUserId>114819</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>this routine could be incredibly revolutionary. Think of the possibilities! now we only need one list for coordinates! now we only need use of 1 variable in all getkey routines! It's only drawback is the size increase because of the decimal point.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-194428</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-194428</link>
				<description></description>
				<pubDate>Fri, 13 Jun 2008 23:35:47 +0000</pubDate>
				<wikidot:authorName>GoVegan</wikidot:authorName>				<wikidot:authorUserId>35113</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Your code doesn't work for me, the y axis seems to be inverted (up is down, and down is up). I find that this can be fixed in two ways:</p> <div class="code"> <pre><code>A+(K=26)-(K=24)-.001((K=34)-(K=25→A or A+(K=26)-(K=24)+.001((K=25)-(K=34→A</code></pre></div> <p>Also, what if you had the window variables (0, 94, 0, .64) ? Then your code could be even smaller:</p> <div class="code"> <pre><code>A+(K=26)-(K=24)+.01((K=25)-(K=34→A</code></pre></div> <p>Otherwise, you have a pretty clever routine there!</p> <p><strong><em>Cheers ~ James Kanjo</em></strong></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-194247</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-194247</link>
				<description></description>
				<pubDate>Fri, 13 Jun 2008 21:28:20 +0000</pubDate>
				<wikidot:authorName>darkstone knight</wikidot:authorName>				<wikidot:authorUserId>141837</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>you can disp X coord whitout ipart(</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-194015</guid>
				<title>Re: new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-194015</link>
				<description></description>
				<pubDate>Fri, 13 Jun 2008 19:02:30 +0000</pubDate>
				<wikidot:authorName>builderboy</wikidot:authorName>				<wikidot:authorUserId>141501</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>But you loose speed when you need to separate the single coordinate into x and y to display it.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-67037#post-193795</guid>
				<title>new (faster) getkey</title>
				<link>http://tibasicdev.wikidot.com/forum/t-67037/new-faster-getkey#post-193795</link>
				<description></description>
				<pubDate>Fri, 13 Jun 2008 17:11:11 +0000</pubDate>
				<wikidot:authorName>darkstone knight</wikidot:authorName>				<wikidot:authorUserId>141837</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>we used to do this<br /> X+(K=26)-(K=24→X<br /> Y+(K=34)-(K=25→Y</p> <p>but, whit window setting (0,94,0, 0.064<br /> the folowing is TWO secs faster (@ 500 executes)</p> <p>A+(K=26)-(K=24)+.001((K=34)-(K=25→A</p> <p>now, lets asume you are making a snake game, you store both coordinates in a list<br /> X→∟X(I<br /> Y→∟Y(I</p> <p>or?</p> <p>A→∟A(I</p> <p>at this point, you are FIVE (&lt;&#8212;&#8212;yes, this is correct) seconds faster</p> <p>also, becus you use only ONE coordinate, say hello to this command:<br /> hi, my name is ans, and im fast</p> <p>brilliant, isn,t it?</p> 
				 	]]>
				</content:encoded>							</item>
				</channel>
</rss>