<?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>Optimize Me (new threads)</title>
		<link>http://tibasicdev.wikidot.com/forum/c-29294/optimize-me</link>
		<description>Threads in the forum category &quot;Optimize Me&quot; - Test your optimization prowess</description>
				<copyright></copyright>
		<lastBuildDate>Thu, 12 Mar 2026 10:41:32 +0000</lastBuildDate>
		
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-14389620</guid>
				<title>binary to decimal</title>
				<link>http://tibasicdev.wikidot.com/forum/t-14389620/binary-to-decimal</link>
				<description>is there anything else possible?</description>
				<pubDate>Sun, 19 Dec 2021 03:34:43 +0000</pubDate>
				<wikidot:authorName>imcoraline</wikidot:authorName>				<wikidot:authorUserId>6725643</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>im not trying for speed, im trying for size. right now, on my ti83+, this program takes up 37 ram (with a one letter program name, if that changes anything). is there any further optimization possible at this point?</p> <p>(note: the code takes a binary number in a list (that list is Ans) and outputs the decimal equivalent. for example, 101<sub>2</sub> is {1,0,1}.)</p> <div class="code"> <pre><code>4ֿ¹sum(seq(Ans(1+dim(Ans)-A)2(2^A),A,1,dim(Ans</code></pre></div> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-13818028</guid>
				<title>help me optimize my first program</title>
				<link>http://tibasicdev.wikidot.com/forum/t-13818028/help-me-optimize-my-first-program</link>
				<description>this is the first program I ever made in TI basic and I know it can be optimized, I just don&#039;t know how. it&#039;s quite a big program so it might take a while to optimize.</description>
				<pubDate>Thu, 15 Oct 2020 14:24:38 +0000</pubDate>
				<wikidot:authorName>Edspeedy</wikidot:authorName>				<wikidot:authorUserId>6934993</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>this is the first program I ever made in TI basic and I know it can be optimized, I just don't know how. it's quite a big program so it might take a while. The program is a simple dungeon crawler that never really ends.</p> <div class="code"> <pre><code>ClrDraw ClrHome Clear Entries 0→P 14→X 5→Y 0→L &quot;θ&quot;→Str1 &quot;#&quot;→Str2 Goto 2 Lbl D Output(5,13,&quot;Game Over&quot;) Wait 2 {15,3,3→SAVE Stop Lbl 2 Menu(&quot;Game&quot;,&quot;Continue&quot;,3,&quot;New Game&quot;,6,&quot;Quit&quot;,4) Lbl O4 Menu(&quot;Style?&quot;,&quot;#&quot;,O5,&quot;X&quot;,O6) Lbl O5 &quot;#&quot;→Str2 Goto 6 Lbl O6 &quot;X&quot;→Str2 Goto 6 Lbl C9 randInt(1,5)→Z randInt(0,4)→W randInt(0,3)→S Z+H→H W+A→A S+D→D Output(4,12,Z Output(5,12,W Output(6,12,S Output(4,11,&quot;+&quot; Output(5,11,&quot;+&quot; Output(6,11,&quot;+&quot; Output(4,13,&quot; Health&quot; Output(5,13,&quot; Attack&quot; Output(6,13,&quot; Defence&quot; 0→[A](Y,X) Pause For(R,4,6) For(Q,11,20) If [A](R,Q)=1 Then Output(R,Q,Str2) End If [A](R,Q)=0 Then Output(R,Q,&quot; &quot;) End If [A](R,Q)=2 Then Output(R,Q,&quot;E&quot;) End If [A](R,Q)=3 Then Output(R,Q,&quot;C&quot;) End End End Goto 5 Lbl 7 Output(1,1,&quot; &quot;) Output(2,1,&quot; &quot;) Output(3,1,&quot; &quot;) Output(4,1,&quot; &quot;) Output(5,1,&quot; &quot;) Output(6,1,&quot; &quot;) Output(7,1,&quot; &quot;) For(Q,1,26) Output(8,Q,&quot;#&quot;) End For(Q,1,26) Output(9,Q,&quot;#&quot;) End Output(10,14,&quot;#&quot;) Output(7,21,&quot;||&quot;) Output(6,19,&quot;+/(&quot;) Output(6,22,&quot;)\&quot;) Output(5,21,&quot;O&quot;) Output(5,19,&quot;|&quot;) Output(7,2,&quot;||&quot;) Output(6,1,&quot;/(&quot;) Output(6,3,&quot;)\+&quot;) Output(5,3,&quot;O&quot;) Output(5,5,&quot;|&quot;) round(H,0)→H randInt(H-5,H+15)→E E→G randInt(A-2,A+3)→V H→B randInt(D-2,D+3)→I If I&gt;A A-3→I Goto C1 Lbl C1 Output(4,2,E If E&lt;5 Then If E≤0 Then Goto WN End End Output(4,21,&quot; &quot;) Output(4,21,H) Output(4,2,&quot; &quot;) Output(4,2,E) Wait 0.5 Output(3,20,&quot; &quot;) Output(3,1,&quot; &quot;) If H≤0 Then Goto D End Menu(&quot;What Will You Do&quot;,&quot;Attack&quot;,A1,&quot;Heal&quot;,H) Lbl WN 0→[A](Y,X) H+5→H If M=11 Goto M1 If M=12 Goto M2 If M=13 Goto M3 If M=14 Goto M4 If M=15 Goto M5 Goto 82 Lbl H H+2+(1.5D)→H If H&gt;1.5B H-5→H If H&gt;2B B→H round(H,1)→H Goto E1 Lbl A1 E-1.2A→E Output(3,1,&quot;-&quot;) Output(3,3,1.2A) Goto E1 Lbl E1 randInt(1,2)→J If J=1 Goto E2 If J=2 Then E+I→E Goto C1 End Lbl E2 randInt(1,3)→J If J=1 Then Output(3,20,&quot;miss&quot;) Goto C1 End If J&gt;1 H-0.8V→H Output(3,20,&quot;-&quot;) Output(3,21,0.8V) Goto C1 End Lbl 6 15→H 3→A 3→D Goto 9 Lbl 1 Menu(&quot;Pause&quot;,&quot;Continue&quot;,5,&quot;Inventory&quot;,I,&quot;Save &amp; Quit&quot;,4) Lbl I For(R,1,10 For(Q,1,26 Output(R,Q,&quot; &quot;) End End Disp &quot;Health&quot; Disp H Disp &quot;Attack&quot; Disp A Disp &quot;Defence&quot; Disp D Pause Goto 82 Lbl 4 {H,A,D→SAVE ClrHome ClrDraw Stop Lbl 3 ⌊SAVE(1→H ⌊SAVE(2→A ⌊SAVE(3→D Goto 9 Lbl 9 {1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1→⌊MP201 {1,1,1,1,1,1,1,0,1,0,1,1,1,0,1,1,1,0,1,0,1,1,1,1,1,1→⌊MP202 {1,1,1,1,1,1,0,1,0,1,0,0,0,0,0,0,0,1,0,1,0,1,1,1,1,1→⌊MP203 {1,1,1,1,1,1,1,0,1,0,0,0,1,0,1,0,0,0,1,0,1,1,1,1,1,1→⌊MP204 {0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0→⌊MP205 {1,1,1,1,1,1,1,0,1,0,0,0,1,0,1,0,0,0,1,0,1,1,1,1,1,1→⌊MP206 {1,1,1,1,1,1,0,1,0,1,0,0,0,0,0,0,0,1,0,1,0,1,1,1,1,1→⌊MP207 {1,1,1,1,1,1,1,0,1,0,1,1,1,0,1,1,1,0,1,0,1,1,1,1,1,1→⌊MP208 {1,1,1,1,1,1,1,1,0,1,0,0,1,0,1,0,0,1,0,1,1,1,1,1,1,1→⌊MP209 {1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1→⌊MP210 Listmatr(⌊MP201,⌊MP202,⌊MP203,⌊MP204,⌊MP205,⌊MP206,⌊MP207,⌊MP208,⌊MP209,⌊MP210,[A] [A]→[A] Output(1,1,&quot;############# ############&quot;) Output(2,1,&quot;####### # ### ### # ######&quot;) Output(3,1,&quot;###### # # # # #####&quot;) Output(4,1,&quot;####### # # # # ######&quot;) Output(5,1,&quot; # # &quot;) Output(6,1,&quot;####### # # # # ######&quot;) Output(7,1,&quot;###### # # # # #####&quot;) Output(8,1,&quot;####### # ### ### # ######&quot;) Output(9,1,&quot;######## # # # # #######&quot;) Output(10,1,&quot;############# ############&quot;) Goto 5 Lbl X {1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1→⌊MP101 {1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1→⌊MP102 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1→⌊MP103 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1→⌊MP104 {0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0→⌊MP105 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1→⌊MP106 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1→⌊MP107 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1→⌊MP108 {1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1→⌊MP109 {1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1→⌊MP110 Listmatr(⌊MP101,⌊MP102,⌊MP103,⌊MP104,⌊MP105,⌊MP106,⌊MP107,⌊MP108,⌊MP109,⌊MP110,[A] [A]→[A] Goto 8 Lbl 10 randInt(11,15)→M If M=K Goto 10 M→K DelVar [A] {10,26→dim([A] If M=11 Goto 11 If M=12 Goto 12 If M=13 Goto 13 If M=14 Goto 14 If M=15 Goto 15 If M=16 Goto 16 Lbl 11 {1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1→⌊MP101 {1,1,0,0,0,1,0,0,1,1,0,1,1,0,0,0,1,3,1,0,0,0,1,1,3,1→⌊MP102 {1,3,0,1,0,0,2,1,0,0,0,0,0,1,1,0,0,2,1,0,1,0,1,0,0,1→⌊MP103 {1,1,1,1,1,1,0,1,0,1,1,0,1,0,0,0,1,1,0,0,1,0,1,2,1,1→⌊MP104 {0,0,0,0,0,0,0,1,0,0,1,0,0,0,1,0,2,0,0,1,1,0,0,0,0,0→⌊MP105 {1,1,1,0,1,1,0,0,0,1,1,1,0,1,1,1,1,1,1,0,1,1,1,0,1,1→⌊MP106 {1,3,1,0,1,0,1,1,0,0,1,0,2,0,1,0,0,1,0,0,0,0,1,0,0,1→⌊MP107 {1,0,0,0,1,0,0,2,1,0,1,0,1,0,1,1,0,2,0,1,1,0,0,1,0,1→⌊MP108 {1,1,0,1,3,0,1,0,0,0,0,1,1,0,1,3,0,1,0,0,3,1,0,0,0,1→⌊MP109 {1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1→⌊MP110 Listmatr(⌊MP101,⌊MP102,⌊MP103,⌊MP104,⌊MP105,⌊MP106,⌊MP107,⌊MP108,⌊MP109,⌊MP110,[A] [A]→[A] Goto M1 Lbl M1 Output(1,1,&quot;############# ############&quot;) Output(2,1,&quot;## # ## ## #C# ##C#&quot;) Output(3,1,&quot;#C # E# ## E# # # #&quot;) Output(4,1,&quot;###### # ## # ## # #E##&quot;) Output(5,1,&quot; # # # E ## &quot;) Output(6,1,&quot;### ## ### ###### ### ##&quot;) Output(7,1,&quot;#C# # ## # E # # # #&quot;) Output(8,1,&quot;# # E# # # ## E ## # #&quot;) Output(9,1,&quot;## #C # ## #C # C# #&quot;) Output(10,1,&quot;############# ############&quot;) Goto 5 Lbl 12 {1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1→⌊MP101 {1,0,0,0,1,3,1,3,1,0,2,0,1,0,1,3,1,0,0,1,0,1,1,0,3,1→⌊MP102 {1,3,1,0,2,0,1,0,1,3,1,0,0,0,1,0,2,0,1,0,0,0,0,0,1,1→⌊MP103 {1,1,0,0,1,1,1,2,0,1,0,0,1,1,1,1,1,0,0,0,1,0,1,0,0,1→⌊MP104 {0,0,1,2,1,0,0,1,0,1,0,1,0,0,0,1,0,0,1,1,1,0,0,1,0,0→⌊MP105 {1,0,0,0,1,1,0,0,0,1,0,0,0,1,0,1,1,0,1,3,2,1,0,0,1,1→⌊MP106 {1,1,1,0,0,1,0,1,1,0,0,1,1,0,0,0,0,0,0,1,0,1,1,0,1,1→⌊MP107 {1,0,0,0,1,0,0,0,1,0,1,3,0,1,1,0,1,1,1,1,0,0,0,0,0,1→⌊MP108 {1,3,1,0,2,0,1,0,0,0,1,1,0,0,0,0,0,1,3,0,2,1,0,1,0,1→⌊MP109 {1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1→⌊MP110 Listmatr(⌊MP101,⌊MP102,⌊MP103,⌊MP104,⌊MP105,⌊MP106,⌊MP107,⌊MP108,⌊MP109,⌊MP110,[A] [A]→[A] Goto M2 Lbl M2 Output(1,1,&quot;############# ############&quot;) Output(2,1,&quot;# #C#C# E # #C# # ## C#&quot;) Output(3,1,&quot;#C# E # #C# # E # ##&quot;) Output(4,1,&quot;## ###E # ##### # # #&quot;) Output(5,1,&quot; #E# # # # # ### # &quot;) Output(6,1,&quot;# ## # # ## #CE# ##&quot;) Output(7,1,&quot;### # ## ## # ## ##&quot;) Output(8,1,&quot;# # # #C ## #### #&quot;) Output(9,1,&quot;#C# E # ## #C E# # #&quot;) Output(10,1,&quot;############# ############&quot;) Goto 5 Lbl 13 {1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1→⌊MP101 {1,3,0,1,0,0,1,3,1,1,0,3,1,0,1,1,3,1,0,0,0,3,1,2,0,1→⌊MP102 {1,1,2,1,0,1,1,0,0,2,0,1,0,0,0,0,0,2,0,1,0,1,1,0,1,1→⌊MP103 {1,0,0,0,0,0,0,1,1,1,0,0,1,1,0,1,0,1,1,0,0,1,0,0,0,1→⌊MP104 {0,0,1,0,1,0,1,0,1,0,1,0,0,0,2,1,0,1,0,1,0,0,0,1,0,0→⌊MP105 {1,0,1,0,0,1,0,0,0,0,1,1,0,1,0,0,1,0,0,0,1,0,1,0,1,1→⌊MP106 {1,1,1,1,0,0,0,1,0,1,1,0,0,1,1,0,0,0,1,0,0,0,2,0,1,1→⌊MP107 {1,3,0,1,0,1,1,1,0,0,0,0,1,1,0,2,1,0,1,0,1,1,0,1,3,1→⌊MP108 {1,1,0,0,2,0,0,3,1,0,1,0,0,0,0,1,0,0,1,0,3,1,0,0,0,1→⌊MP109 {1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1→⌊MP110 Listmatr(⌊MP101,⌊MP102,⌊MP103,⌊MP104,⌊MP105,⌊MP106,⌊MP107,⌊MP108,⌊MP109,⌊MP110,[A] [A]→[A] Goto M3 Lbl M3 Output(1,1,&quot;############# ############&quot;) Output(2,1,&quot;#C # #C## C# ##C# C#E #&quot;) Output(3,1,&quot;##E# ## E # # # ## ##&quot;) Output(4,1,&quot;# ### ## # ## # #&quot;) Output(5,1,&quot; # # # # # E# # # # &quot;) Output(6,1,&quot;# # # ## # # # # ##&quot;) Output(7,1,&quot;#### # ## ## # E ##&quot;) Output(8,1,&quot;#C # ### ## E# # ## #C#&quot;) Output(9,1,&quot;## E C# # # # C# #&quot;) Output(10,1,&quot;############# ############&quot;) Goto 5 Lbl 14 {1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1→⌊MP101 {1,3,0,0,0,2,0,0,1,3,1,0,0,0,0,0,0,1,2,0,3,1,1,0,3,1→⌊MP102 {1,1,1,1,0,1,0,1,0,0,0,2,1,1,0,1,0,0,0,1,1,0,0,0,1,1→⌊MP103 {1,0,0,0,1,0,0,1,1,1,1,0,0,1,0,0,1,0,1,0,0,0,1,0,0,1→⌊MP104 {0,0,1,0,1,0,1,0,0,0,0,1,0,1,1,0,1,0,0,0,1,1,0,1,0,0→⌊MP105 {1,1,1,0,0,0,0,0,1,1,0,0,0,0,1,0,0,1,1,0,0,2,0,1,1,1→⌊MP106 {1,0,0,0,1,1,0,1,0,1,1,1,1,0,0,1,1,3,1,0,1,1,0,0,0,1→⌊MP107 {1,1,2,1,3,1,2,1,0,0,2,0,1,1,0,0,0,2,1,0,0,0,1,0,1,1→⌊MP108 {1,3,0,1,0,0,0,3,1,3,1,0,0,0,0,1,0,1,0,0,1,1,3,0,0,1→⌊MP109 {1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1→⌊MP110 Listmatr(⌊MP101,⌊MP102,⌊MP103,⌊MP104,⌊MP105,⌊MP106,⌊MP107,⌊MP108,⌊MP109,⌊MP110,[A] [A]→[A] Goto M4 Lbl M4 Output(1,1,&quot;############# ############&quot;) Output(2,1,&quot;#C E #C# #E C## C#&quot;) Output(3,1,&quot;#### # # E## # ## ##&quot;) Output(4,1,&quot;# # #### # # # # #&quot;) Output(5,1,&quot; # # # # ## # ## # &quot;) Output(6,1,&quot;### ## # ## E ###&quot;) Output(7,1,&quot;# ## # #### ##C# ## #&quot;) Output(8,1,&quot;##E#C#E# E ## E# # ##&quot;) Output(9,1,&quot;#C # C#C# # # ##C #&quot;) Output(10,1,&quot;############# ############&quot;) Goto 5 Lbl 15 {1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1→⌊MP101 {1,3,0,0,2,0,1,3,1,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,3,1→⌊MP102 {1,1,1,0,1,3,1,0,0,1,0,0,0,1,3,0,1,0,0,1,1,0,0,0,1,1→⌊MP103 {1,0,0,2,1,1,0,1,2,0,0,1,1,0,1,0,0,0,1,0,3,1,0,1,1,1→⌊MP104 {0,0,1,0,0,1,2,0,0,1,0,0,1,0,2,0,1,1,0,2,1,0,0,1,0,0→⌊MP105 {1,1,3,1,0,1,0,1,1,3,1,0,1,0,1,1,3,1,0,1,0,0,1,0,0,1→⌊MP106 {1,0,0,2,0,1,0,0,1,0,1,0,0,0,0,1,0,0,0,1,0,1,0,0,1,1→⌊MP107 {1,2,1,1,0,0,1,0,2,0,1,1,2,1,0,0,1,2,1,0,2,0,0,1,3,1→⌊MP108 {1,0,3,3,1,0,0,0,1,0,0,1,0,0,1,0,0,0,1,3,1,1,0,2,0,1→⌊MP109 {1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1→⌊MP110 Listmatr(⌊MP101,⌊MP102,⌊MP103,⌊MP104,⌊MP105,⌊MP106,⌊MP107,⌊MP108,⌊MP109,⌊MP110,[A] [A]→[A] Goto M5 Lbl M5 Output(1,1,&quot;############# ############&quot;) Output(2,1,&quot;#C E #C# # # # # C#&quot;) Output(3,1,&quot;### #C# # #C # ## ##&quot;) Output(4,1,&quot;# E## #E ## # # C# ###&quot;) Output(5,1,&quot; # #E # # E ## E# # &quot;) Output(6,1,&quot;##C# # ##C# # ##C# # # #&quot;) Output(7,1,&quot;# E # # # # # # ##&quot;) Output(8,1,&quot;#E## # E ##E# #E# E #C#&quot;) Output(9,1,&quot;# CC# # # # #C## E #&quot;) Output(10,1,&quot;############# ############&quot;) Goto 5 Lbl 16 {1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1→⌊MP101 {1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1→⌊MP102 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1→⌊MP103 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1→⌊MP104 {0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0→⌊MP105 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1→⌊MP106 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1→⌊MP107 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1→⌊MP108 {1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1→⌊MP109 {1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1→⌊MP110 Listmatr(⌊MP101,⌊MP102,⌊MP103,⌊MP104,⌊MP105,⌊MP106,⌊MP107,⌊MP108,⌊MP109,⌊MP110,[A] [A]→[A] Goto 8 Lbl 82 Output(1,1,&quot;############# ############&quot; For(R,2,9 Output(R,1,&quot;#&quot; Output(R,26,&quot;#&quot; End Output(5,1,&quot; &quot; Output(5,26,&quot; &quot; Output(10,1,&quot;############# ############&quot; Goto 8 Lbl 8 For(R,2,9 For(Q,2,25 If [A](R,Q)=1 Then Output(R,Q,Str2) End If [A](R,Q)=0 Then Output(R,Q,&quot; &quot;) End If [A](R,Q)=2 Then Output(R,Q,&quot;E&quot;) End If [A](R,Q)=3 Then Output(R,Q,&quot;C&quot;) End End End Goto 5 Lbl 5 0→P While 1=1 Output(Y,X,Str1) getKey→P If P=24 Then If X-1=0 Then Output(Y,X,&quot; &quot;) 26→X Output(Y,X,Str1) Goto 10 Else If [A](Y,X-1)=2 Then Output(Y,X,&quot; &quot;) X-1→X Goto 7 End If [A](Y,X-1)=3 Then Output(Y,X,&quot; &quot;) X-1→X Goto C9 End If [A](Y,X-1)=0 Then Output(Y,X,&quot; &quot;) X-1→X End End Output(Y,X,Str1) Else If P=34 Then If Y+1=11 Then Output(Y,X,&quot; &quot;) 1→Y Output(Y,X,Str1) Goto 10 Else If [A](Y+1,X)=2 Then Output(Y,X,&quot; &quot;) Y+1→Y Goto 7 End If [A](Y+1,X)=3 Then Output(Y,X,&quot; &quot;) Y+1→Y Goto C9 End If [A](Y+1,X)=0 Then Output(Y,X,&quot; &quot;) Y+1→Y End End Output(Y,X,Str1) Else If P=25 Then If Y-1=0 Then Output(Y,X,&quot; &quot;) 10→Y Output(Y,X,Str1) Goto 10 Else If [A](Y-1,X)=2 Then Output(Y,X,&quot; &quot;) Y-1→Y Goto 7 End If [A](Y-1,X)=3 Then Output(Y,X,&quot; &quot;) Y-1→Y Goto C9 End If [A](Y-1,X)=0 Then Output(Y,X,&quot; &quot;) Y-1→Y End End Output(Y,X,Str1) Else If P=26 Then If X+1=27 Then Output(Y,X,&quot; &quot;) 1→X Output(Y,X,Str1) Goto 10 Else If [A](Y,X+1)=2 Then Output(Y,X,&quot; &quot;) X+1→X Goto 7 End If [A](Y,X+1)=3 Then Output(Y,X,&quot; &quot;) X+1→X Goto C9 End If [A](Y,X+1)=0 Then Output(Y,X,&quot; &quot;) X+1→X End End Output(Y,X,Str1) End If P=105 Then Goto 1 End 1+L→L If L&gt;5 Then &quot;θ&quot;→Str1 End If L&gt;10 Then &quot;0&quot;→Str1 0→L End 0→P End End End End End End End End End</code></pre></div> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-13757076</guid>
				<title>Bogo Sort also know as Stupid Sort.</title>
				<link>http://tibasicdev.wikidot.com/forum/t-13757076/bogo-sort-also-know-as-stupid-sort</link>
				<description>This is a highly inefficient sort algorithm that I have not been able to implement on a my TI in BASIC.</description>
				<pubDate>Thu, 24 Sep 2020 01:52:08 +0000</pubDate>
				<wikidot:authorName>byates</wikidot:authorName>				<wikidot:authorUserId>2077636</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Bogo Sort is one of the worst sorting algorithms around. But can be fun to watch run, if you are as easily amused as I am.</p> <p>For some reason I have not been able to make it work on the TI calculator I have, I blame my meds. Could some one implement it so that it shows the random version in action?</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-13375088</guid>
				<title>Optimize a Conway&#039;s Game of Life Program</title>
				<link>http://tibasicdev.wikidot.com/forum/t-13375088/optimize-a-conway-s-game-of-life-program</link>
				<description>Yes, I know this website has an official version of Conway&#039;s Game of Life, but I want to use my own.</description>
				<pubDate>Mon, 25 May 2020 23:39:01 +0000</pubDate>
				<wikidot:authorName>OneLetterShor</wikidot:authorName>				<wikidot:authorUserId>4737965</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <div class="code"> <pre><code>ClrHome {11,28}→dim([A]) For(A,2,10) For (B,2,27) max(0,randInt(⁻3,1))→[A](A,B) Output(A,B-1),&quot;O&quot;) End:End 0→G Output(1,1,&quot;GENERATION&quot;) Output(1,16,&quot;MEMBERS=&quot;) Repeat getKey or M=0 G+1→G For(A,2,10) For(B,1,26) Output(A,B,sub(&quot; O&quot;,[A](A,B+1)+1,1)) End:End Output(1,12,G) Output(1,24,&quot; &quot;) //four spaces [A]→[B] 0→M For(A,2,10) For(B,2,27) Output(A,B-1,&quot;θ&quot;) If [A](A,B)=1:M+1→M Output(1,24,M) 0→N For(C,-1,1) For(D,-1,1) If [A](A+C,B+D) and 2≠sum(not({C,D}≠0)):N+1→N End:End If N=3 and [A](A,B)=0 1→[B](A,B) If [A](A,B)=1 and N≠2 and N≠3 0→[B](A,B) Output(A,B-1,sub(&quot; O&quot;,[A](A,B)+1,1)) End:End [B]→[A] End</code></pre></div> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-13317277</guid>
				<title>Optimize a Worley Noise Program</title>
				<link>http://tibasicdev.wikidot.com/forum/t-13317277/optimize-a-worley-noise-program</link>
				<description>I made a Worley Noise Program for Ti-Basic on my TI-84+CE, but it can probably be optimized.</description>
				<pubDate>Thu, 14 May 2020 18:54:03 +0000</pubDate>
				<wikidot:authorName>OneLetterShor</wikidot:authorName>				<wikidot:authorUserId>4737965</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I would like to have this optimized as much as possible. Speed is more important than size in my opinion.</p> <div class="code"> <pre><code>ClrHome:ClrDraw 38→A:24→B:8→N:1→M randInt(0,A-1,N)→⸤SEEDX randInt(0,B-1,N)→⸤SEEDY {11,15,19,14,10,13,23,22,21,20}→⸤COLOR 0→R &quot;√((⸤SEEDX(I)-K)²+(⸤SEEDY(I)-L)²&quot;→u For(K,0,A) For(L,0,B) N→dim(⸤DISTS) For(I,1,N) u→⸤DISTS(I) End SortA(⸤DISTS) If ⸤DISTS(M)&gt;R ⸤DISTS(M)→R End:End For(K,0,A) For(L,0,B) For(I,1,N) u→⸤DISTS(I) End SortA(⸤DISTS) ⸤COLOR(max(1,(min,23,int(round(10*⸤DISTS(M)/R,0)))))→C Pt-On(K,L,C) Pt-On(K,L,2,C) End:End For(I,1,N) Pt-On(⸤SEEDX(I),⸤SEEDY(I),BLACK) Pt-On(⸤SEEDX(I),⸤SEEDY(I),2,BLACK) End</code></pre></div> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-13317120</guid>
				<title>Optimize my Rubik&#039;s Cube Timer program *please*</title>
				<link>http://tibasicdev.wikidot.com/forum/t-13317120/optimize-my-rubik-s-cube-timer-program-please</link>
				<description></description>
				<pubDate>Thu, 14 May 2020 17:57:47 +0000</pubDate>
				<wikidot:authorName>mathsman502</wikidot:authorName>				<wikidot:authorUserId>5919669</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>This is my Rubik's Cube timer program:<br /> I've tried to optimize it as much as possible, and here is the program so far:<br /> Note: → is represented as [-&gt;] , small E is represented as slash e slash , ≤ is represented as [&lt;=] and ≠ is represented as [!=]</p> <div class="code"> <pre><code>prgmTITIMER1 //Generates notation string &quot;F'F F2B'BB2R'R R2L'LL2U'UU2D'DD2 -&gt; Str1 //Asks what character you want around the border, and if length is not 1, repeats the action Lbl 0 Prompt Str3 If 1!=length(Str3 Goto 0 //Draws border For(X,1,16 For(Y,1,8 If X=1 or X=16 or Y=1 or Y=8 Output(Y,X,Str3 End:End //Starts a Loop for E, which at the end of the code will put the final time at the 'E'th part of L₆ DelVarDFor(E,1,/e/9 //Generates scramble For(C,2,5 2-&gt;B //This part of scramble generating doesn't use a For( loop because that will mean gaps in the scramble, see near end of While loop While B&lt;=14 randInt(1,18-&gt;A //This part prevents redundancy If int(A/6)=int(D/6 Goto 1 Output(C,B,sub(Str1,2A-1,2 A-&gt;D B+2-&gt;B Lbl 1 End:End Output(7,2,&quot;Press [Enter]. Pause For(C,2,7 Output(C,2,&quot; //14 spaces End Output(4,9,0 Pause //Actual timer (the timing system isn't entirely accurate, but I wanted to save information on the increment level, and it's only off by ~1 second every 5 minutes.) For(A,1,/e/9,.022 Output(4,5,A If getKey: Goto 2 End Lbl 2 A-&gt;L₆(E Pause End</code></pre></div> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-13301523</guid>
				<title>Optimize a Cellular Automata Program</title>
				<link>http://tibasicdev.wikidot.com/forum/t-13301523/optimize-a-cellular-automata-program</link>
				<description>I made a very cool program to demonstrate elementary cellular automata, but I want it to run faster.</description>
				<pubDate>Sat, 09 May 2020 17:33:01 +0000</pubDate>
				<wikidot:authorName>Mr Bob Jr IV</wikidot:authorName>				<wikidot:authorUserId>5320134</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>This program is a stripped down version of a cellular automata drawing tool I made. I think one-dimensional cellular automata so cool, because they make such awesome patterns out of something so simple! There is a good page on Wolfram MathWorld on elementary cellular automata if you want to learn how they work!</p> <p>For now, all you need to know to help with this program is that there is a line of cells across the top, and each one is either on or off. When it advances to the next generation of cells (drawn in on the next line), it changes one cell's state based on the cell to the left and the cell to the right. Because of this, the program has to check each cell in the row to determine if it should stay on, stay off, or change state. I am hoping there is a faster way to do this, since right now it takes a very long time to draw an entire screen.</p> <p>W is the width of the screen that the calculator is drawing on (and it is centered at 132, the middle of the screen for a TI 84 CE)<br /> Str1 is an 8 digit string of zeroes and ones. The calculator determines how a cell should change by checking the cell and its left and right neighbor and turning that into a number 1-8 (because there are 8 different states the 3 cells could be in). The number corresponds to a digit in Str1 and determines if that cell should be on or off. Str1 can be changed to show any of the rules for cellular automata.</p> <div class="code"> <pre><code>For(Y,0,163) For(X,132-W/2,132+W/2) If expr(sub(Str1,8-4(pxl-Test(Y,X-1))-2(pxl-Test(Y,X))-pxl-Test(Y,X+1),1 Pxl-On(Y+1,X End End</code></pre></div> <p>There are online programs that can do this in a matter of seconds. Is there a way I can make this loop run faster? I have tried referencing a list of 8 numbers instead of a string, but it didn't appear to run faster. I'm hoping there is something that I have missed, but it's possible that a calculator just can't run any faster. If you have any ideas of how to speed this up, I would greatly appreciate it!</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-13228597</guid>
				<title>Factoring Program Optimizations</title>
				<link>http://tibasicdev.wikidot.com/forum/t-13228597/factoring-program-optimizations</link>
				<description>I&#039;m trying to optimize a factoring program of mine so that it can be as small as possible.</description>
				<pubDate>Fri, 10 Apr 2020 18:14:27 +0000</pubDate>
				<wikidot:authorName>Z_dude</wikidot:authorName>				<wikidot:authorUserId>5690022</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>This is a factoring program I made that outputs all of the factor pairs of a number. I've been trying to make it as small as possible, rather than optimizing for speed, but it is still very fast. Any ideas on further optimizations?</p> <div class="code"> <pre><code>:Prompt A :For (I,1,1+int(√(A))) //In this case, I know I am losing 3 bytes. This is the only case where I am factoring for speed, since leaving the parentheses here off will slow it down 20x. :If not(fPart(A/I //Using remainder( is faster, (I think), but it's a byte more, and I don't care enough about the tiny speed loss. :Then :Disp I :Pause A/I :End :End</code></pre></div> <p>I'm asking because I don't see any other optimizations. And to think that this used to be 120 bytes!</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-13216405</guid>
				<title>Sprite-to-hex automater</title>
				<link>http://tibasicdev.wikidot.com/forum/t-13216405/sprite-to-hex-automater</link>
				<description>I need help optimizing a program that you can draw an 8x8 sprite in, and then output the 16-character hex code for it.</description>
				<pubDate>Mon, 06 Apr 2020 13:16:48 +0000</pubDate>
				<wikidot:authorName>Z_dude</wikidot:authorName>				<wikidot:authorUserId>5690022</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I made a program to design 8x8 monochrome sprites and then output the 16-character hex code for it. I've been doing some optimizations, but I feel like it could lose quite a lot of bytes, and at the end when it calculates the hex code it could be much faster. Any ideas? (Sorry that this is such a mess.) My focus is mainly on size, except for the last part, which I'm trying to optimize for speed.</p> <p>This code essentially draws 2 boxes: One, with opposite vertices of (18,-18) and (29,-29), is for the user. A small cross (I used Pt-On for this) is moved around by the arrow keys, and is prevented from leaving the square. The square is 10x10, but the movement area is 8x8, so that the cross cannot erase any of the square.<br /> The second box has opposite vertices of (38,-18) and (49,-29), and is for the image. When the user presses &quot;Enter,&quot; the pixel in the Image box corresponding to the position of the user in the User box changes color. So you move the user in the user box, then press Enter to change around how the Image box looks. This is solely so that the image isn't screwed up by having the user pointer in it. The Image Box also is 10x10, so that even if the entire 8x8 sprite is filled, there is a layer of white pixels between the box outlines and the sprite.</p> <div class="code"> <pre><code>Recall GDB0 //See note below on GDB0 DispGraph 18→X 29→Y Line(X,-X,X,-Y //This entire mess of code is to draw the 2 box outlines. Line(X,-X,Y,-X Line(Y,-Y,X,-Y Line(Y,-Y,Y,-X 38→I 49→J Line(I,-X,J,-X Line(I,-X,I,-Y Line(J,-Y,I,-Y Line(J,-Y,J,-X 0→K //Keypress Tester 20→X -20→Y Pt-On(X,Y,3 Repeat K=22 //This main loop gets exited out when the user presses &quot;Mode&quot; Repeat Ans getKey //Waits for a keypress End Ans→K Pt-Off(X,Y,3 //Erases the user pointer max(20,min(27,X=sum(ΔList(K={24,26→X //Change X and Y coords max(-27,min(-20,Y+sum(ΔList(K={34,25→Y Pt-On(X,Y,3 //Redraw User Pointer If K=105 //If you press Enter, change the Image Square pixel Pxl-Change(-Y,20+X If K=23:Then //If you press Del, clear the Image box For(I,40,47 For(J,20,27 Pxl-Off(J,I End:End:End If K=45 //If Clear is pressed, end the Program Return End //When Mode is pressed, the main loop terminates, and the to-hex part begins &quot;?→Str1 For(I,0,15 //Repeat for all 16 4-by-1 &quot;segments&quot; of the image, each of which is 1 character. remainder(I,2→J //Calculate if this segment is on the right or left side of the image 20+(I-J)/2→K //Figure out which row of the image this segment is on 0 //Reset Ans For(X,3,0,-1 Ans+2^X*pxl-Test(K,40+4J+3-X //Each time it loops through, it reads a new pixel in the segment, and adds it on to Ans. So 1110 translates to 8=8, 8+4=12, 12+2=14, so the value output at the end of this loop is 14. End sub(&quot;0123456789ABCDEF&quot;,Ans+1,1 //Translates the decimal value into a hex value Str1+Ans→Str1 //Adds the letter (which is the hex value of that segment) onto Str1 End sub(Str1,2,length(Str1)-1→Str1 //Gets rid of the &quot;?&quot; at the beginning of Str1 Ans</code></pre></div> <p>Note on GDB0:<br /> This is here so that all of the graph settings get set so that Xmin=0, Xmax=94, Ymin=-62, Ymax=0 (so that every pixel has its own coordinates, making the Pxl-On( and Pt-On( interchangeable, and to improve usage with the Line(Command</p> <p>Note on what I mean by &quot;Segments:&quot;<br /> An 8x8 sprite outputs a 16-character hex string. Each set of 4 pixels in a row translates to half a byte, or one of those characters. So the string of pixels 1101 would translate to the hex character D. I call each of these segments &quot;segments&quot; (I think the proper term is actually nibbles, but I'm not sure.) There are 2 segments per row of the sprite, and 8 rows of the image, which makes the 16 segments.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-12916047</guid>
				<title>Tic Tac Toe</title>
				<link>http://tibasicdev.wikidot.com/forum/t-12916047/tic-tac-toe</link>
				<description>Been done many times before, but here&#039;s my version</description>
				<pubDate>Thu, 09 Jan 2020 08:42:03 +0000</pubDate>
				<wikidot:authorName>Xillin</wikidot:authorName>				<wikidot:authorUserId>5994759</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I purposely didn't look at any other Tic Tac Toe programs during/before I made this as I wanted it to be 100% origional. It works fine, but could probably use a little optimization here and there. Let me know what you think - suggestions, criticism, pros, cons</p> <div class="code"> <pre><code>:Lbl Y :Clrhome :AxesOff :ZStandard :ZSquare :Vertical 4 :Vertical -4 :Line(-11,3.7,11,3.7 :Line(-11,-3.7,11,-3.7 :0→T :0→G :0→H :DelVar [A]{3,3→dim([A] :Repeat T=9 :0→A :Repeat A&gt;7.1 and A&lt;9.5 :.1getKey→A :If A=1.1 :Goto A :End :10fPart(A)-1→C :iPart(A)-6→D :If [A](D,C)=0 :Then :T+1→T :7.5C-15→X :-7D+14→Y :If fPart(T/2 :Then :Line(X-2,Y-2,X+2,Y+2,18 :Line(X-2,Y+2,X+2,Y-2,18 :→[A](D,C :Else :Circle(X, Y, 2, 15 :-1→[A](D, C :End :If T&gt;4 :Then :If abs([A](1,C)+[A](2,C)+[A](3,C))=3 :Then :Line(X,8,X,-8,11 :1→H :End :If abs([A](D,1)+[A](D,2)+[A](D,3))=3 :Then :Line(-8.5,Y,8.5,Y,11 :1→H :End :If abs([A](2,2))=1 :Then :If abs([A](1,1)+[A](2,2)+[A](3,3))=3 :Then :Line(-7.5,7,7.5,-7,11 :1→H :End :If abs([A](3,1)+[A](2,2)+[A](1,3))=3 :Then :Line(-7.5,-7,7.5,7,11 :1→H :End :End :If H :Then :Text(-1,10,10,sub(&quot;XO&quot;,(fPart(T/2)=0)+1,1)+&quot; WINS!!! :9→T :Pause :End :End :End :End :Lbl A :Menu(&quot;PLAY AGAIN?&quot;,&quot;YES&quot;,Y,&quot;NO&quot;,N :Lbl N :ClrDraw :ClrHome :&quot;</code></pre></div> <br /> I opted for a nicer-looking program (at least in my opinion), though it does result in it being larger
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-12843438</guid>
				<title>Is this as optimized as this radical simplifier gets?</title>
				<link>http://tibasicdev.wikidot.com/forum/t-12843438/is-this-as-optimized-as-this-radical-simplifier-gets</link>
				<description>I&#039;ve simplified it as much as I can, but can it get any smaller?</description>
				<pubDate>Tue, 03 Dec 2019 19:25:37 +0000</pubDate>
				<wikidot:authorName>Zorianak</wikidot:authorName>				<wikidot:authorUserId>5925327</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <div class="code"> <pre><code>PROGRAM:XROOTOFθ :ClrHome :Disp &quot;ˣ√θ :Prompt X,θ :round(Xˣ√θ,0→N :If not(N :Return :While fPart(θ/N^X :DS&lt;(N,2 :End :ClrHome :Disp &quot;Nˣ√θ&quot;,&quot;N=&quot;,N,&quot;θ= :θ/N^X→θ</code></pre></div> <br /> Just in case anyone was wondering about the last line's &quot;→θ&quot;, that's so it actually stores θ as θ in case the user wants to use θ later
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-12842456</guid>
				<title>Could you make my Cookie Clicker Program faster?</title>
				<link>http://tibasicdev.wikidot.com/forum/t-12842456/could-you-make-my-cookie-clicker-program-faster</link>
				<description>Can you make it faster?</description>
				<pubDate>Mon, 02 Dec 2019 22:21:33 +0000</pubDate>
				<wikidot:authorName>mathsman502</wikidot:authorName>				<wikidot:authorUserId>5919669</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>If you can make my code faster, then please do! I am open to your suggestions and interested in seeing what you all come up with!<br /> :D</p> <p>Here's the plaintext:</p> <div class="code"> <pre><code>15→A 100→B 0→C 1100→ D 12000→E 130000→F 1400000→G 0→H C→M 0→P Lbl 1 0→Z ClrDraw While Z65 //(This will keep happening until “M” is pressed, then it will show the heavenly cookies / prestige option.This will come up later.) C+P→C M+P→M //This gives 1 second (or frame, more exactly) of cookies to C, the cookie indicator, and gives it to M, the “This Prestige” cookies made all time marker (It’s reset when prestige is bought, but until then, it just increases with cookies) Text(0,1,”COOKIES:” Text(0,32,int(C Text(0,60,”CPS:” Text(10,75,int(P*10)/10 getKey→Z //(Z is the variable used for all getKey purposes, and checks once every frame to see what button was pressed since the previous check. It gets slower once the framerate gets slower, typically later in the game, as their speeds are about the same.) If Z=53 or Z=83 Then C+max(1,int(P/100)→C M+max(1,int(P/100)→M End //The above If-Then statement basically states that if you press 5 or cos( , then it will give you one cookie or 1/100 of your CPS, or cookies per second, whichever is greater. Text(8,1,”ITEM: Text(9,40,”COST Text(9,75,”CPS //For all you perfectionists out there (no offense), I have it so the “ITEM:” figure is slightly higher than the others so if someone takes the idea, they can have them all at the same level or at different levels, but they cannot do exactly what I did. Text(16,1,”CURSOR Text(22,1,”GRANDMA Text(28,1,”FARM Text(34,1,”MINE Text(40,1,”FACTORY Text(46,1,”BANK //That was the item display code... Text(16,40,A Text(22,40,B Text(28,40,D Text(34,40,E Text(40,40,F Text(46,40,G //That was the price display code… Text(16,75,int(0.1(1.01^H)*10/10 //This is the only CPS block that has a decimal, as it represents the cursor. Text(22,75,int(1(1.01^H)) Text(28,75,int(8(1.01^H)) Text(34,75,int(40(1.01^H)) Text(40,75,int(250(1.01^H)) Text(46,75,int(1000(1.01^H)) //Those were the CPS per item blocks, by the way. If Z=11 and C&gt;=A Then C-A→C int(1.2A→A P+0.1(1.01^H)→P ClrDraw End //That was basically saying if the Y= button was pressed it would buy a cursor, increase cursor price by 20%, and add Cursor CPS to P, the CPS marker. If Z=12 and C&gt;=B Then C-B→C int(1.2B→B P+1(1.01^H)→P ClrDraw End //It’s basically the same with all the other buildings, but with Window, Zoom, Trace, Graph, and Up. If Z=13 and C&gt;=D Then C-D→C int(1.2D→D P+8(1.01^H)→P ClrDraw End If Z=14 and C&gt;=E Then C-E→C int(1.2E→E P+40(1.01^H)→P ClrDraw End If Z=15 and C&gt;=F Then C-F C int(1.2F F P+250(1.01^H)→P ClrDraw End If Z=25 and C&gt;=G Then C-G→C int(1.2G→G P+1000(1.01^H)→P ClrDraw End End //(If this is gotten to, then it shows prestige.) ClrDraw Text(1,1,”RESET NOW AND GET” Text(20,1,”HEAVENLY CHIPS?” //That was all the static prestige elements before the Menu( element. Text(10,6,int(.01\sqrt\M))) //If you don’t know already, the \sqrt\ is just a square root symbol. Pause Menu(“RESET?”,”YES”,A,”NO”,B Lbl B Goto 1 Lbl A 15→A 100→B 0→C 1100→D 12000→E 130000→F 1400000→G 0→P H+int(0.01√(M)))→H 0 M ClrDraw Goto 1</code></pre></div> <br /> //And that’s it! Please let me know if you have any suggestions for making it faster! Your input is appreciated!
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-11511509</guid>
				<title>Can you see if there is a way to optimize my password program</title>
				<link>http://tibasicdev.wikidot.com/forum/t-11511509/can-you-see-if-there-is-a-way-to-optimize-my-password-progra</link>
				<description>See if you can optimize this in any way</description>
				<pubDate>Thu, 02 May 2019 01:21:19 +0000</pubDate>
				<wikidot:authorName>Thatguy87878</wikidot:authorName>				<wikidot:authorUserId>5334047</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <div class="code"> <pre><code>:ClrHome :Disp “PASSWORD” :Input “1=”,A :Input “2=”,B :Input “3=”,C :Input “4=”,D ((A+B)*C)*D￫P :If P=18 :Then :Disp “Right” :Else :Disp “Wrong” :End</code></pre></div> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-11315751</guid>
				<title>Printer</title>
				<link>http://tibasicdev.wikidot.com/forum/t-11315751/printer</link>
				<description>How can I make this faster?</description>
				<pubDate>Tue, 23 Apr 2019 17:15:13 +0000</pubDate>
				<wikidot:authorName>OneLetterShor</wikidot:authorName>				<wikidot:authorUserId>4737965</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>This code has no usefulness, but it looks cool. You draw anything on the graph screen, and the program will store it to L₁ and L₂. The way it works is it scans the whole graph for turned-on pixels using pxl-Test( and stores their X &amp; Y pixel coordinates to L₁ and L₂, respectively. It then clears the graph screen and prints out the image, pixel by pixel. The problem is that the scanning/storing part is really slow on my TI-84 Plus CE. And I mean reeeeeeaaaaaaaly slow. If their is any way to speed the program up, please let me know.</p> <div class="code"> <pre><code>ClrHome 1→dim(L₁ 1→dim(L₂ For(Y,0,164 For(X,0,264 If pxl-Test(Y,X Then augment(L₁,{X→L₁ augment(L₂,{Y→L₂ End End End ClrDraw For(X,2,dim(L₁ Pxl-On(L₂(X),L₁(X),BLACK End</code></pre></div> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-10423137</guid>
				<title>Factors of a whole number</title>
				<link>http://tibasicdev.wikidot.com/forum/t-10423137/factors-of-a-whole-number</link>
				<description>Trying to see if it is at all possible to make this smaller or know of a better way of going about it</description>
				<pubDate>Mon, 25 Feb 2019 20:20:02 +0000</pubDate>
				<wikidot:authorName>wifijoe</wikidot:authorName>				<wikidot:authorUserId>2922498</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Hello! It's&#8230; Been quite a while, though that's my fault. I've been working on this program recently, trying to make it smaller and smaller, and now I think it's the smallest it can get, unless there's a better way of going about it. It takes the input, A and uses a for( loop to go from 1 to A with the variable B. It uses a list and finds all of the factors that go into A. Willing to see anything on it! And no, I'm not very good with lists</p> <div class="code"> <pre><code>:DelVar L₁1→C :Input A :For(B,1,A :A/B→L₁(C:C+not(fPart(Ans→C :End:L₁</code></pre></div> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-9499510</guid>
				<title>Homescreen Movement Collision Optimization</title>
				<link>http://tibasicdev.wikidot.com/forum/t-9499510/homescreen-movement-collision-optimization</link>
				<description></description>
				<pubDate>Sat, 22 Dec 2018 03:41:41 +0000</pubDate>
				<wikidot:authorName>Misfire</wikidot:authorName>				<wikidot:authorUserId>4409570</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I am working on a game in which I cannot say what because of a agreement between me and the owner of the actual game as this is a port of that. So what is going on is the player cannot move into the top of the screen, but the code for collision is very long and has to be defined for every single &quot;cell&quot;, (dunno what to call them) on the map. So for just the top, you have this very long code, I am scared of that slowing the game. I use a different homescreen movement routine that is easy to understand, link for explanation here if you can't figure it out: <a href="http://rcdev00.wikidot.com/doc:home-movement-routine">http://rcdev00.wikidot.com/doc:home-movement-routine</a> (The only thing in there not explained is how the collision works)</p> <p>Small Piece of the game:</p> <div class="code"> <pre><code>If M=0002 Then ClrHome Output(1,1,&quot;TEST MAP 2&quot; Pause ClrHome 200-&gt;G 5-&gt;X 6-&gt;Y 1-&gt;S While 1 Repeat I getKey-&gt;I Output(Y,X,&quot;X&quot; If I=24 Then ClrHome X-1-&gt;X End If I=25 Then ClrHome Y-1-&gt;Y End If I=26 Then ClrHome X+1-&gt;X End If I=34 Then ClrHome Y+1-&gt;Y End If S=1 Then Output(1,1,&quot;TTTTTTTTTTTTTTTT&quot; Output(8,1,&quot;TTTTTTTTTTTTTTTT&quot; End If S=2 Then Output(3,4,&quot;III&quot; End If Y=1 and S=1 //Collision Detection Then If X=1 Then 2-&gt;Y End If X=2 Then 2-&gt;Y End If X=3 Then 2-&gt;Y End If X=4 Then 2-&gt;Y End If X=5 Then 2-&gt;Y End If X=6 Then 2-&gt;Y End If X=7 Then 2-&gt;Y End If X=8 Then 2-&gt;Y End If X=9 Then 2-&gt;Y End If X=10 Then 2-&gt;Y End If X=11 Then 2-&gt;Y End If X=12 Then 2-&gt;Y End If X=13 Then 2-&gt;Y End If X=14 Then 2-&gt;Y End If X=15 Then 2-&gt;Y End If X=16 Then 2-&gt;Y End End End End End</code></pre></div> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-8804941</guid>
				<title>C Optimization</title>
				<link>http://tibasicdev.wikidot.com/forum/t-8804941/c-optimization</link>
				<description>printf op</description>
				<pubDate>Thu, 22 Nov 2018 02:35:55 +0000</pubDate>
				<wikidot:authorName>Misfire</wikidot:authorName>				<wikidot:authorUserId>4409570</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>How would you optimize this in C?</p> <div class="code"> <pre><code>... int main() { printf(&quot;Hello World\n&quot;); printf(&quot;Hello World\n&quot;); printf(&quot;I'm still here dawg\n&quot;); return 0; }</code></pre></div> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-8317051</guid>
				<title>Finding the seeds</title>
				<link>http://tibasicdev.wikidot.com/forum/t-8317051/finding-the-seeds</link>
				<description>A program to find the seed values that maximize the output of rand</description>
				<pubDate>Wed, 31 Oct 2018 15:35:40 +0000</pubDate>
				<wikidot:authorName>Deoxal</wikidot:authorName>				<wikidot:authorUserId>4178723</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>When reading the page on the <a href="http://tibasicdev.wikidot.com/rand">rand command</a> this piqued my interest:</p> <blockquote> <p>Note: Due to specifics of the random number generating algorithm, the smallest number possible to generate is slightly greater than 0. The largest number possible is actually 1, but since returning a result of 1 would mess up the output of randBin( and randNorm(, the actual value returned in such cases is 1-1.11e-12 (which is displayed as 1, and is &quot;equal&quot; to 1 for the purposes of the = command). To see 1, store 196164532 to rand and then run the random number generator.</p> </blockquote> <p>I'm a little confused about this statement since the output of rand is not used as the next value to compute rand since seeds are rounded down to an integer. Regardless, it and <a href="http://tibasicdev.wikidot.com/forum/t-8101641/the-random-seed-function">CloudVariable's post</a> inspired me to write this code.<br /> <strong>It's purpose is to record values of rand(and their seeds) that are greater than their predecessor's value.</strong></p> <div class="collapsible-block"> <div class="collapsible-block-folded"><a class="collapsible-block-link" href="javascript:;">+&nbsp;Show&nbsp;Code</a></div> <div class="collapsible-block-unfolded" style="display:none"> <div class="collapsible-block-unfolded-link"><a class="collapsible-block-link" href="javascript:;">-&nbsp;Hide&nbsp;Code</a></div> <div class="collapsible-block-content"> <div class="code"> <pre><code>Input &quot;RUN AT LAST VAL?&quot;,C // By setting C to 0, the program will initialize the needed variables. If C // Setting C to anything else the code will pick up where it left off, but if X, C, or the last values of Goto A // L₁ or L₂ have been modified you will most likely get an error and if not then inaccurate data. 1→X 0→rand 1→dim(L₁ 1→dim(L₂ X→L₁(1 1→C 1→⸤SAV(1 rand→L₂(1 Disp C,L₂(1 Lbl A ⸤SAV(1→X dim(L₁→C // This loop is the part I actually want to optimize. Repeat getKey=22 // Press [MODE] to safely exit the program. X→rand rand→A If A&gt;L₂(C // Checks to see if the new random value is larger than the last random value. Then C+1→C A→L₂(C // Saves the number to check against future values in A. X→L₁(C // Saves the seed used to generate the value in A. Disp &quot;&quot;,C,A End X+1→X End X→⸤SAV(1</code></pre></div> </div> </div> </div> <br /> <a href="https://drive.google.com/file/d/157LSzvlKkTTwiyvol5Jq1LJCjdvofglH/view?usp=sharing">Here is the uncommented version</a> if you want to run the program. <p>Obviously I'm looking for optimizations, but let me know if you think I have a bug anywhere as well.</p> <p>This program is essentially a brute force approach to finding the values I want, I'm interested in analyzing the <a href="https://stackoverflow.com/questions/32788122/ti-84-plus-random-number-generator-algorithm">algorithm</a> as well, but as of now I don't understand how to do that.<br /> <strong>I.E. is it possible to algebraically solve for seed values that output values close to 1, equal to 1, or the value closest to 0?</strong></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-7944808</guid>
				<title>Unit Circle</title>
				<link>http://tibasicdev.wikidot.com/forum/t-7944808/unit-circle</link>
				<description>I feel like this can be smaller and faster.</description>
				<pubDate>Thu, 11 Oct 2018 20:13:11 +0000</pubDate>
				<wikidot:authorName>OneLetterShor</wikidot:authorName>				<wikidot:authorUserId>4737965</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>PROGRAM:UNITCIRC</p> <div class="code"> <pre><code>:Lbl 10 :ClrHome :Menu(&quot;UNIT CIRCLE&quot;,&quot;CONVERSIONS&quot;,11,&quot;UNIT CIRCLE&quot;,3,&quot;QUIT&quot;,4) :Lbl 11 :ClrHome :Menu(&quot;CONVERSIONS&quot;,&quot;DEGREES -&gt; RADIANS&quot;,1,&quot;RADIANS -&gt; DEGREES&quot;,2,&quot;BACK&quot;,10) :Lbl 1 :Input &quot;DEGREE MEASURE: &quot;,D :Radian :Disp Dº :Pause :Goto 11 :Lbl 2 :Input &quot;RADIAN MEASURE :&quot;,R :Degree :Disp R^^r^^ :Pause :Goto 11 :Lbl 3 :ClrHome :Menu(&quot;UNIT CIRCLE FUNCTIONS&quot;,&quot;ANGLE FROM DEGREE&quot;,5,&quot;ANGLE FROM RADIAN&quot;,6,&quot;ANGLE FROM COORDINATE&quot;,7,&quot;BACK&quot;,10) :Lbl 5 :Input &quot;DEGREE MEASURE: &quot;,A :Degree :Goto 9 :Lbl 6 :Input &quot;RADIAN MEASURE: &quot;,A :Radian :Goto 9 :Lbl 7 :Input &quot;X=&quot;,X :Input &quot;Y=&quot;,Y :Degree :R▶Pθ(X,Y)→A :Lbl 9 :StoreGDB 1 :ClrDraw :AxesOff :ZStandard :ZSquare :Horizontal 0,BLACK :Vertical 0,BLACK :Circle(0,0,9,BLUE) :Line(0,0,P▶Rx(9,A),P▶Ry(9,A),RED) :Pause :RecallGDB 1 :Goto 3 :Lbl 4 :Stop</code></pre></div> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-6632652</guid>
				<title>Optimizations? I think so</title>
				<link>http://tibasicdev.wikidot.com/forum/t-6632652/optimizations-i-think-so</link>
				<description>How many optimizations are there for this code?</description>
				<pubDate>Fri, 27 Jul 2018 14:58:17 +0000</pubDate>
				<wikidot:authorName>Trenly</wikidot:authorName>				<wikidot:authorUserId>1905506</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>So, by now many of you know that I am recreating MENACE on the monochrome series of calculators. I have a lot of the program made, and have a few Ideas on how to implement the retrieval of the game board. However, that is not my concern right now. What I am hoping is to find as many optimizations as possible, for both speed and size! Keep in mind that this code was not originally coded cleanly, it was just coded to work. I will include comments later whenever I have time to add them in:</p> <div class="collapsible-block"> <div class="collapsible-block-folded"><a class="collapsible-block-link" href="javascript:;">View&nbsp;the&nbsp;Uncommented&nbsp;version&nbsp;of&nbsp;the&nbsp;code</a></div> <div class="collapsible-block-unfolded" style="display:none"> <div class="collapsible-block-unfolded-link"><a class="collapsible-block-link" href="javascript:;">Hide&nbsp;Block</a></div> <div class="collapsible-block-content"> <div class="code"> <pre><code>//!-- List of all the variables: &gt; ʟM : A list which keeps track of the moves in order as game spots (1-9), prepended with 0. &gt; ʟMC : A list which is used for tracking the moves in order as primes, prepended with 0. Used for checking win conditions &gt; ʟMP : The list of probabilities to use when selecting a spot to play; AI use only &gt; GDB1 : A GDB which stores the initial graph settings, used for cleanup &gt; Xmin, Xmax, Ymin, Ymax : Graph variables which determine the screen scaling &gt; T : A real variable which keeps track of which turn it is, 1 or 2 &gt; C : A real variable used to temporarily track the cell choice &gt; H : A real variable used to store the horizontal of the currently selected cell &gt; V : A real variable used to store the vertical of the currently selected cell &gt; K : A real variable used to track keypresses &gt; P : A real variable used to track the highlighted cell &gt; G : A real variable used to store where the Game Peice (X or O) gets displayed horizontally &gt; U : A real variable used to store where the Game Peice (X or O) gets displayed vertically &gt; E : A real variable used to track for loop iterations &gt; A : A real variable used to keep track of the prime multiples &gt; W : A real variable used as a flag to determine if win conditions have been met --!// SetUpEditor ʟM,ʟMC,ʟMP {0→ʟM {0→ʟMC StoreGDB GDB1 AxesOff GridOff CoordOff Full LabelOff ExprOff RectGC Normal Func 63→Ymax:0→Ymin 93→Xmax:0→Xmin ClrDraw Text(⁻1,2,14,&quot;M.E.N.A.C.E. Line(29,49,65,49 Line(65,49,65,13 Line(65,13,29,13 Line(29,13,29,49 Line(32,47,62,47 Line(31,46,63,46 Line(63,46,63,16 Line(62,47,62,15 Line(62,15,32,15 Line(61,15,33,15 Line(31,16,31,46 Line(32,15,32,47 Line(42,45,42,15 Line(52,45,52,15 Line(33,25,61,25 Line(33,36,61,36 19→H 35→V 1→P Repeat dim(ʟM)=10 1→T If fPart(dim(ʟM)/2):2→T If T=2:Text(⁻1,52,10,&quot;CROSSES TURN! If T=1:Text(⁻1,52,10,&quot;NAUGHTS TURN! If (T=2)(dim(ʟM)&lt;10):Then {3,7,9,2,4,7,5,1,1}→ʟMP If dim(ʟM)&lt;4:{0,0,8,0,0,2,0,0,0}→ʟMP prgmAI Repeat not(sum(C=ʟM ʟMP 1+sum(cumSum(Ans)&lt;randsum(Ans→C End C→P End Line(H+14,V+2,H+22,V+2 Repeat C or sum(K={45,21,105 Repeat C or sum(K={45,21,105,24,25,26,34 getKey→K End If K=45:ClrHome If K=45:Stop If C or sum(K={24,25,26,34:Then Line(H+14,V+2,H+22,V+2,0 P+(K=26)(P&lt;9)-(K=24)(P&gt;1)+3(K=34)(P≤6)-3(K=25)(P≥4)→P P/3 If Ans≤1:35→V If Ans≤2:24→V If Ans≤3:14→V If sum(P={1,4,7 19→H If sum(P={2,5,8 29→H If sum(P={3,6,9 39→H Line(H+14,V+2,H+22,V+2 If C:105→K DelVar C End End If (K=105)not(sum(P=ʟM:Then P→ʟM(1+dim(ʟM Line(H+14,V+2,H+22,V+2,0 P/3 If Ans≤1:19→G If Ans≤2:29→G If Ans≤3:39→G If sum(P={1,4,7 35→U If sum(P={2,5,8 46→U If sum(P={3,6,9 56→U Text(⁻1,G,U,sub(&quot;OX&quot;,T,1) expr(sub(&quot;020305071113171923&quot;,2P-1,2))→ʟMC(dim(ʟM If dim(ʟMC)≥6:Then 1→A For(E,2,dim(ʟMC),2 AʟMC(E)→A End If not(sum(not(fPart(A/{30,1001,7429,238,627,1495,506,935}):Then 1→A For(E,3,dim(ʟMC),2 AʟMC(E)→A End End sum(not(fPart(A/{30,1001,7429,238,627,1495,506,935})→W If W:10→dim(ʟM AxesOff End DelVar C End End If T:Text(⁻1,52,10,&quot; &quot; If not(W:Then Text(⁻1,52,23,&quot;TIE GAME! Pause Else If T=2:Text(⁻1,52,15,&quot;CROSSES WIN! If T=1:Text(⁻1,52,15,&quot;NAUGHTS WIN! If T:Pause End RecallGDB GDB1 ClrDraw ClrHome</code></pre></div> </div> </div> </div> <div> <p>-or-</p> </div> <div class="collapsible-block"> <div class="collapsible-block-folded"><a class="collapsible-block-link" href="javascript:;">View&nbsp;the&nbsp;Commented&nbsp;version&nbsp;of&nbsp;the&nbsp;code</a></div> <div class="collapsible-block-unfolded" style="display:none"> <div class="collapsible-block-unfolded-link"><a class="collapsible-block-link" href="javascript:;">Hide&nbsp;Block</a></div> <div class="collapsible-block-content"> <div class="code"> <pre><code>//!-- List of all the variables: &gt; ʟM : A list which keeps track of the moves in order as game spots (1-9), prepended with 0. &gt; ʟMC : A list which is used for tracking the moves in order as primes, prepended with 0. Used for checking win conditions &gt; ʟMP : The list of probabilities to use when selecting a spot to play; AI use only &gt; GDB1 : A GDB which stores the initial graph settings, used for cleanup &gt; Xmin, Xmax, Ymin, Ymax : Graph variables which determine the screen scaling &gt; T : A real variable which keeps track of which turn it is, 1 or 2 &gt; C : A real variable used to temporarily track the cell choice &gt; H : A real variable used to store the horizontal of the currently selected cell &gt; V : A real variable used to store the vertical of the currently selected cell &gt; K : A real variable used to track keypresses &gt; P : A real variable used to track the highlighted cell &gt; G : A real variable used to store where the Game Peice (X or O) gets displayed horizontally &gt; U : A real variable used to store where the Game Peice (X or O) gets displayed vertically &gt; E : A real variable used to track for loop iterations &gt; A : A real variable used to keep track of the prime multiples &gt; W : A real variable used as a flag to determine if win conditions have been met --!// SetUpEditor ʟM,ʟMC,ʟMP //Set up the lists we need {0→ʟM //prepend 0's to the lists to initialize them {0→ʟMC StoreGDB GDB1 //store a GDB for cleanup AxesOff //set up the graph screen GridOff CoordOff Full LabelOff ExprOff RectGC Normal Func 63→Ymax:0→Ymin //set our graph variables 93→Xmax:0→Xmin ClrDraw //clear the graph screen Text(⁻1,2,14,&quot;M.E.N.A.C.E. //draw the gameboard Line(29,49,65,49 Line(65,49,65,13 Line(65,13,29,13 Line(29,13,29,49 Line(32,47,62,47 Line(31,46,63,46 Line(63,46,63,16 Line(62,47,62,15 Line(62,15,32,15 Line(61,15,33,15 Line(31,16,31,46 Line(32,15,32,47 Line(42,45,42,15 Line(52,45,52,15 Line(33,25,61,25 Line(33,36,61,36 19→H //set the initial horizontal 35→V //set the initial vertical 1→P //set the initial highlighted cell Repeat dim(ʟM)=10 //repeat until 9 turns have been played 1→T //Reset the turn variable If fPart(dim(ʟM)/2):2→T //double check the turn variable with the list of moves played If T=2:Text(⁻1,52,10,&quot;CROSSES TURN! //display who's turn it is If T=1:Text(⁻1,52,10,&quot;NAUGHTS TURN! If (T=2)(dim(ʟM)&lt;10):Then //This is where the AI plays {3,7,9,2,4,7,5,1,1}→ʟMP //this line is for testing and debugging only, it will be removed If dim(ʟM)&lt;4:{0,0,8,0,0,2,0,0,0}→ʟMP //this line is for testing and debugging only, it will be removed prgmAI //this program will fetch the gameboard and recall the learning state into ʟMP Repeat not(sum(C=ʟM //ensure we don't select a square that has already been filled ʟMP //store this to Ans 1+sum(cumSum(Ans)&lt;randsum(Ans→C //select a spot to play using partial probability End C→P //update the graphics for the selected cell End Line(H+14,V+2,H+22,V+2 //Honestly forgot what this was for, probably for highlighting the selected cell Repeat C or sum(K={45,21,105 //repeat until the user makes a choice, or an exit key is pressed Repeat C or sum(K={45,21,105,24,25,26,34 //wait until an arrow or exit key is pressed getKey→K End If K=45:ClrHome //if K=45 immediately exit the program If K=45:Stop If C or sum(K={24,25,26,34:Then //if a choice was made or an arrow key was pressed Line(H+14,V+2,H+22,V+2,0 //erase the selected cell highlighting P+(K=26)(P&lt;9)-(K=24)(P&gt;1)+3(K=34)(P≤6)-3(K=25)(P≥4)→P //move the selected cell P/3 If Ans≤1:35→V //calculate the V and H of the newly selected cell If Ans≤2:24→V If Ans≤3:14→V If sum(P={1,4,7 19→H If sum(P={2,5,8 29→H If sum(P={3,6,9 39→H Line(H+14,V+2,H+22,V+2 //redraw the cell highlighting on the new cell If C:105→K //if a choice was made by the AI, simulate pressing enter DelVar C //delete C to prevent errors End End If (K=105)not(sum(P=ʟM:Then //if enter was pressed and the cell is not already chosen, then P→ʟM(1+dim(ʟM //add the cell into the list of previously played moves Line(H+14,V+2,H+22,V+2,0 //erase the cell highlighting P/3 If Ans≤1:19→G //calculate the position of the game piece to output If Ans≤2:29→G If Ans≤3:39→G If sum(P={1,4,7 35→U If sum(P={2,5,8 46→U If sum(P={3,6,9 56→U Text(⁻1,G,U,sub(&quot;OX&quot;,T,1) //output the game piece based on the turn expr(sub(&quot;020305071113171923&quot;,2P-1,2))→ʟMC(dim(ʟM //convert the position to the corresponding prime, and store it into the list of primes If dim(ʟMC)≥6:Then //if more than 5 moves have been played, check to see if anyone has won 1→A //reset A For(E,2,dim(ʟMC),2 //for each of the turn 1 plays AʟMC(E)→A //multiply the prime corresponding to those plays End If not(sum(not(fPart(A/{30,1001,7429,238,627,1495,506,935}):Then //if the turn 1 plays did not win 1→A //reset A For(E,3,dim(ʟMC),2 //for each of the turn 2 plays AʟMC(E)→A //multiply the primes corresponding to those plays End End sum(not(fPart(A/{30,1001,7429,238,627,1495,506,935})→W //if A is divisible by one of the prime multiplicatives, then a player has won If W:10→dim(ʟM //simulate extra moves by expanding the main list AxesOff //return to the graph, this is only precautionary End DelVar C End End If T:Text(⁻1,52,10,&quot; &quot; //erase the old text If not(W:Then //if nobody won, it was a tie game Text(⁻1,52,23,&quot;TIE GAME! Pause Else //if somebody did win, display who won based on the turn If T=2:Text(⁻1,52,15,&quot;CROSSES WIN! If T=1:Text(⁻1,52,15,&quot;NAUGHTS WIN! If T:Pause End RecallGDB GDB1 //clean up the graph settings ClrDraw ClrHome</code></pre></div> </div> </div> </div> <p>A bit of explanation on confusing parts:</p> <p>C is the actual selected square, or the <strong>choice</strong> the player made<br /> P is the highlighted <strong>position</strong> on the gameboard<br /> C and P should be the same 90% of the time, but I used 2 variables because thats just how I did it (deal with it)</p> The way I am checking for wins is this:<br /> <table class="wiki-content-table"> <tr> <td>2</td> <td>3</td> <td>5</td> </tr> <tr> <td>7</td> <td>11</td> <td>13</td> </tr> <tr> <td>17</td> <td>19</td> <td>23</td> </tr> </table> <p>By using the first 9 primes, each row column and diagonal will multiply together to a unique product (30, 1001, 7429, 238, 627, 1495, 506, or 935). I take the positions already played (as their corresponding primes), and take the product. If the product is divisible by any of the 8 unique prime products with no remainder, then it means that somebody has won.</p> 
				 	]]>
				</content:encoded>							</item>
				</channel>
</rss>