<?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>Optimization</title>
		<link>http://tibasicdev.wikidot.com/forum/t-640426/optimization</link>
		<description>Posts in the discussion thread &quot;Optimization&quot; - I need help optimizing this part of code for a game. Especially the Lbl G1 to If K. Let me know if you need more code to help.</description>
				<copyright></copyright>
		<lastBuildDate>Tue, 21 Jul 2026 03:53:57 +0000</lastBuildDate>
		
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-640426#post-1747984</guid>
				<title>Re: Optimization</title>
				<link>http://tibasicdev.wikidot.com/forum/t-640426/optimization#post-1747984</link>
				<description></description>
				<pubDate>Sun, 07 Apr 2013 00:26:19 +0000</pubDate>
				<wikidot:authorName>Pongo42</wikidot:authorName>				<wikidot:authorUserId>1593163</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Thanks this helps a LOT</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-640426#post-1746813</guid>
				<title>Re: Optimization</title>
				<link>http://tibasicdev.wikidot.com/forum/t-640426/optimization#post-1746813</link>
				<description></description>
				<pubDate>Fri, 05 Apr 2013 02:26:44 +0000</pubDate>
				<wikidot:authorName>Weregoose</wikidot:authorName>				<wikidot:authorUserId>7090</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Assuming there is only one <span class="werecode">Goto</span> for each of <span class="werecode">Lbl GD</span> through <span class="werecode">Lbl GH</span> in the entire program:</p> <div class="werecode"> <p>:If C=25:Then<br /> :Line(X,Z+1,X,62,0<br /> :L<span style="font-size:smaller;">1</span>≥0 and 1≥abs(X-1-L<span style="font-size:smaller;">2</span><br /> :min(6not(Ans)+AnscumSum(not(0Ans→C<br /> :If Ans≠6:Then<br /> :Text(-1,int(L<span style="font-size:smaller;">1</span>(Ans)),L<span style="font-size:smaller;">2</span>(Ans),”<span style="color: #888">·</span><br /> :<span style="font-family:verdana"><span style="font-size:smaller;">E</span></span>9→L<span style="font-size:smaller;">1</span>(Ans<br /> :min(L<span style="font-size:smaller;">1</span>-randInt(4,8→L<span style="font-size:smaller;">1</span>(C<br /> :randInt(24,70→L<span style="font-size:smaller;">2</span>(C<br /> :End:End</p> </div> <p>The line <span class="werecode">:Lbl G2</span> may also be omissible at this point.</p> <p>In case you don't recognize it, this is your <span class="werecode">:If K</span> section synthesized with <span class="werecode">GD</span> through <span class="werecode">GH</span>.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-640426#post-1746659</guid>
				<title>Re: Optimization</title>
				<link>http://tibasicdev.wikidot.com/forum/t-640426/optimization#post-1746659</link>
				<description></description>
				<pubDate>Thu, 04 Apr 2013 20:48:56 +0000</pubDate>
				<wikidot:authorName>Pongo42</wikidot:authorName>				<wikidot:authorUserId>1593163</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>here is the other labels. thank you guys so much for your help. I also included a variable list, so hopefully this is less confusing.<br /> Use A,B,C for garbage vars<br /> Use S for score, and T for how much the score increases<br /> Use X for ship X value<br /> Use Z for ship Y value<br /> Use M,V for how fast the ship moves<br /> Use D,E,F,G,H for NME Y value<br /> Use N,O,P,Q,R for NME X values<br /> Use L for how fast the ships drop<br /> Use W for increasing L<br /> Use I,U for detecting if a NME reaches the end<br /> Use J for resetting NME’s<br /> Use K to detect if you shot</p> <div class="code"> <pre><code>:Lbl GD :Text(-1,int(D),N,” //1 space :min({E-A,F-A,G-A,H-A→D:B→N :Goto G2 :Lbl GE :Text(-1,int(E),O,” :min({D-A,F-A,G-A,H-A→E:B→O :Goto G2 :Lbl GF :Text(-1,int(F),P,” :min({D-A,E-A,G-A,H-A→F:B→P :Goto G2 :Lbl GG :Text(-1,int(G),Q,” :min({D-A,E-A,F-A,H-A→G:B→Q :Goto G2 :Lbl GH :Text(-1,int(H),R,” :min({D-A,E-A,F-A,G-A→H:B→R :Goto G2</code></pre></div> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-640426#post-1746499</guid>
				<title>Re: Optimization</title>
				<link>http://tibasicdev.wikidot.com/forum/t-640426/optimization#post-1746499</link>
				<description></description>
				<pubDate>Thu, 04 Apr 2013 15:42:18 +0000</pubDate>
				<wikidot:authorName>Josiah W</wikidot:authorName>				<wikidot:authorUserId>1521437</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I can only think of these:</p> <div class="code"> <pre><code>:Lbl A //If there are any references to Label G0, change them to A, otherwise lose the label. :47→X:-54→Z :randInt(0,-8→D:randInt(24,70→N :randInt(-13,-21→E:randInt(24,70→O :randInt(-26,-34→F:randInt(24,70→P :randInt(-39,-47→G:randInt(24,70→Q :randInt(-52,-60→H:randInt(24,70→R :Vertical 14 :Vertical 76 :For(A,1,61,3 :Pt-On(randInt(1,11),-A,3 :Pt-On(randInt(77,92),-A,3 :End :Text(-1,28,33,”READY :rand(34 :Text(-1,28,41,”SET :rand(34 :Text(-1,28,41,”GO! :rand(16 :Text(-1,28,33,” //6 spaces :Lbl G :Line(X,Z-1,X-2,Z-7,0 :Line(X,Z-1,X+2,Z-7,0 :Line(X,Z,X,Z-8,0 :getKey→C :V-M((Ans=24)+(Ans=26→V :If C=34:Delvar V :If C=23:Then :Text(-1,28,30,”PAUSED :Text(36,32,”SCORE:”,S :Pause :For(θ,7,9,2 :Text(-1,4θ,23+θ,” //6 spaces :End :End :X+V→X :C=25→K :If Ans :Vertical X :If X≥74 or X≤16 :Goto E :Line(X,Z-1,X-2,Z-7 :Line(X,Z-1,X+2,Z-7 :Line(X,Z,X,Z-8 :Lbl B //Again, any references to G1 must be replaced by B. :S+T→S :If D≥L:Then :Text(int(D-L),N,” :Text(int(D),N,”V :End :If E≥L:Then :Text(int(E-L),O,” :Text(int(E),O,”V :End :If F≥L:Then :Text(int(F-L),P,” //3 spaces :Text(int(F),P,”V :End :If G≥L:Then :Text(int(G-L),Q,” :Text(int(G),Q,”V :End :If H≥L:Then :Text(int(H-L),R,” :Text(int(H),R,”V :End :If K:Then: :randInt(4,8→A :randInt(24,70-&gt;B :Line(X,Z+1,X,Ymax,0 //Do so only if, as with mine, your graph window is 94=Xmax and 62=Ymax. :If (N≤X)(X≤N+2)(D≥0:Goto D //Any occurences of GD, GE, GF, GG, and GH must be replaced with D, E, F, G, and H. :If (O≤X)(X≤O+2)(E≥0:Goto E :If (P≤X)(X≤P+2)(F≥0:Goto F :If (Q≤X)(X≤Q+2)(G≥0:Goto G :If (R≤X)(X≤R+2)(H≥0:Goto H :Else:End :Lbl C //Again, references to G2 must be replaced by C :D+L→D:E+L→E:F+L→F:G+L→G:H+L→H:L+W→L :If D≥58 or E≥58 or F≥58 or G≥58 or H≥58:Goto E :Goto G</code></pre></div> <p>I probably missed some, but I saved a few bytes with the text displaying and labels, at the least.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-640426#post-1746482</guid>
				<title>Re: Optimization</title>
				<link>http://tibasicdev.wikidot.com/forum/t-640426/optimization#post-1746482</link>
				<description></description>
				<pubDate>Thu, 04 Apr 2013 15:18:00 +0000</pubDate>
				<wikidot:authorName>Weregoose</wikidot:authorName>				<wikidot:authorUserId>7090</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <div class="werecode"> <p>:Lbl G0<br /> :47→X:-54→Z<br /> :seq(13X,X,0,4<br /> :-randInt(Ans,Ans+8→L<span style="font-size:smaller;">1</span><br /> :randInt(24,70,5→L<span style="font-size:smaller;">2</span><br /> :Vertical 14<br /> :Vertical 76<br /> :For(A,1,61,3<br /> :Pt-On(randInt(1,11),-A,3<br /> :Pt-On(randInt(77,92),-A,3<br /> :End<br /> :For(A,1,4<br /> :Text(-1,28,33,sub(”READY<span style="color: #888">·</span>SET<span style="color: #888">··</span>GO!<span style="color: #888">······</span>”,5A-4,5<br /> :rand(34-18(A=4<br /> :End</p> <p>:Lbl G<br /> :Line(X,Z-1,X-2,Z-7,0<br /> :Line(X,Z-1,X+2,Z-7,0<br /> :Line(X,Z,X,Z-8,0<br /> :getKey→C<br /> :If Ans=23:Then<br /> :Text(-1,28,30,”PAUSED<br /> :Text(36,32,”SCORE:”,S<br /> :Pause<br /> :Text(-1,28,30,”<span style="color: #888">······</span><br /> :Text(-1,36,32,”<span style="color: #888">······</span><br /> :End<br /> :V-M(Ans=24)+M(Ans=26<br /> :Ans(C≠34→V<br /> :X+Ans→X<br /> :If C=25<br /> :Vertical Ans<br /> :If 29≤abs(Ans-45<br /> :Goto E<br /> :Line(Ans,Z-1,Ans-2,Z-7<br /> :Line(Ans,Z-1,Ans+2,Z-7<br /> :Line(Ans,Z,Ans,Z-8</p> <p>:Lbl G1<br /> :S+T→S<br /> :For(A,1,5<br /> :L<span style="font-size:smaller;">1</span>(A<br /> :If Ans≥L:Then<br /> :Text(int(Ans-L),L<span style="font-size:smaller;">2</span>(A),”<span style="color: #888">···</span><br /> :Text(int(Ans),N,”V<br /> :End:End</p> </div> <p>Let's see <span class="werecode">Lbl GD</span> through <span class="werecode">Lbl GH</span> before I get started on the <span class="werecode">:If K:Then</span> block.</p> <div class="werecode"> <p>:Lbl G2<br /> :L<span style="font-size:smaller;">1</span>+L→L<span style="font-size:smaller;">1</span>:L+W→L<br /> :If max(L<span style="font-size:smaller;">1</span>≥58:Goto E<br /> :Goto G</p> </div> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-640426#post-1746113</guid>
				<title>Optimization</title>
				<link>http://tibasicdev.wikidot.com/forum/t-640426/optimization#post-1746113</link>
				<description></description>
				<pubDate>Thu, 04 Apr 2013 00:16:24 +0000</pubDate>
				<wikidot:authorName>Pongo42</wikidot:authorName>				<wikidot:authorUserId>1593163</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I need help optimizing this part of code for a game. Especially the Lbl G1 to If K. Let me know if you need more code to help.</p> <div class="code"> <pre><code>:Lbl G0 :47→X:-54→Z :randInt(0,-8→D:randInt(24,70→N :randInt(-13,-21→E:randInt(24,70→O :randInt(-26,-34→F:randInt(24,70→P :randInt(-39,-47→G:randInt(24,70→Q :randInt(-52,-60→H:randInt(24,70→R :Vertical 14 :Vertical 76 :For(A,1,61,3 :Pt-On(randInt(1,11),-A,3 :Pt-On(randInt(77,92),-A,3 :End :Text(-1,28,33,”READY :rand(34 :Text(-1,28,33,” SET :rand(34 //1 space either side of ‘SET’ :Text(-1,28,33,” GO! and ‘GO!’ :rand(16 :Text(-1,28,33,” //6 spaces :Lbl G :Line(X,Z-1,X-2,Z-7,0 :Line(X,Z-1,X+2,Z-7,0 :Line(X,Z,X,Z-8,0 :getKey→C :V-M(Ans=24)+M(Ans=26→V :If C=34:0→V :If C=23:Then :Text(-1,28,30,”PAUSED :Text(36,32,”SCORE:”,S :Pause :Text(-1,28,30,” //6 spaces :Text(-1,36,32,” //6 spaces :End :X+V→X :C=25-&gt;K :If Ans :Vertical X :If X≥74 or X≤16 :Goto E :Line(X,Z-1,X-2,Z-7 :Line(X,Z-1,X+2,Z-7 :Line(X,Z,X,Z-8 :Lbl G1 :S+T→S :If D≥L:Then :Text(int(D-L),N,” :Text(int(D),N,”V :End :If E≥L:Then :Text(int(E-L),O,” :Text(int(E),O,”V :End :If F≥L:Then :Text(int(F-L),P,” //3 spaces :Text(int(F),P,”V :End :If G≥L:Then :Text(int(G-L),Q,” :Text(int(G),Q,”V :End :If H≥L:Then :Text(int(H-L),R,” :Text(int(H),R,”V :End :If K:Then: :randInt(4,8→A :randInt(24,70-&gt;B :Line(X,Z+1,X,62,0 :If (N≤X)(X≤N+2)(D≥0:Goto GD :If (O≤X)(X≤O+2)(E≥0:Goto GE :If (P≤X)(X≤P+2)(F≥0:Goto GF :If (Q≤X)(X≤Q+2)(G≥0:Goto GG :If (R≤X)(X≤R+2)(H≥0:Goto GH :Else:End :Lbl G2 :D+L→D:E+L→E:F+L→F:G+L→G:H+L→H:L+W→L :If D≥58 or E≥58 or F≥58 or G≥58 or H≥58:Goto E :Goto G</code></pre></div> 
				 	]]>
				</content:encoded>							</item>
				</channel>
</rss>