<?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>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>Posts in the discussion thread &quot;Could you make my Cookie Clicker Program faster?&quot; - Can you make it faster?</description>
				<copyright></copyright>
		<lastBuildDate>Wed, 11 Mar 2026 17:01:45 +0000</lastBuildDate>
		
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-12842456#post-4437118</guid>
				<title>Re: 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#post-4437118</link>
				<description></description>
				<pubDate>Tue, 03 Dec 2019 05:14:21 +0000</pubDate>
				<wikidot:authorName>Trenly</wikidot:authorName>				<wikidot:authorUserId>1905506</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Ah, the way you used the brackets was confusing</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-12842456#post-4437106</guid>
				<title>Re: 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#post-4437106</link>
				<description></description>
				<pubDate>Tue, 03 Dec 2019 04:24:44 +0000</pubDate>
								<wikidot:authorUserId>3338172</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I am aware you cannot add text in lists. I was clarifying that the text in the second list is a reference to the first example.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-12842456#post-4436993</guid>
				<title>Re: 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#post-4436993</link>
				<description></description>
				<pubDate>Tue, 03 Dec 2019 00:12:38 +0000</pubDate>
				<wikidot:authorName>Trenly</wikidot:authorName>				<wikidot:authorUserId>1905506</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>You can't actually put text in lists though, so you can only store the numbers. So a portion of the optimization <span class="error-inline"><em>Bio_Hazard1282_rPi3</em> does not match any existing user name</span> said is incorrect. I personally think that it is faster and shorter to use the numeric variables in this case, especially given some of the optimizations that I will explain below. If you have any questions on any of them, please let me know and I can try and explain them more.</p> <hr /> <p>One optimization is leaving off ending parentheses.<br /> Example: Text(22,75,int(1(1.01^H)) can be Text(22,75,int(1(1.01^H</p> <p>Another is using the scientific E when dealing with large numbers to save memory.<br /> Example: 1000 can be 1ᴇ3. 1400000 can be 14ᴇ5</p> <hr /> <p>There is a major optimization for your sections of If-Then statements for your building types by using <a href="http://tibasicdev.wikidot.com/piecewise-expressions">Piecewise Expressions</a></p> <p>Your Code:</p> <div class="code"> <pre><code>If Z=11 and C≥A Then C-A→C int(1.2A→A P+0.1(1.01^H)→P ClrDraw End If Z=12 and C≥B Then C-B→C int(1.2B→B P+1(1.01^H)→P ClrDraw End If Z=13 and C≥D Then C-D→C int(1.2D→D P+8(1.01^H)→P ClrDraw End If Z=14 and C≥E Then C-E→C int(1.2E→E P+40(1.01^H)→P ClrDraw End If Z=15 and C≥F Then C-F C int(1.2F F P+250(1.01^H)→P ClrDraw End If Z=25 and C≥G Then C-G→C int(1.2G→G P+1000(1.01^H)→P ClrDraw End</code></pre></div> <p>Can be shortened to:</p> <div class="code"> <pre><code>If sum(Z={12,13,14,15,25:Then P+(1.01^H)(.1(Z=11)(C≥A)+(Z=12)(C≥B)+8(Z=13)(C≥D)+40(Z=14)(C≥E)+250(Z=15)(C≥F)+1ᴇ3(Z=25)(C≥G→P A+.2B(Z=11)(C≥A→A B+.2B(Z=12)(C≥B→B D+.2D(Z=13)(C≥D→D E+.2E(Z=14)(C≥E→E F+.2F(Z=15)(C≥F→F G+.2G(Z=25)(C≥G→G C-A(Z=11)(C≥A)-B(Z=12)(C≥B)-D(Z=13)(C≥D)-E(Z=14)(C≥E)-F(Z=15)(C≥F)-G(Z=25)(C≥G→C ClrDraw End</code></pre></div> <div class="collapsible-block"> <div class="collapsible-block-folded"><a class="collapsible-block-link" href="javascript:;">+Show&nbsp;Explanation</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;Explanation</a></div> <div class="collapsible-block-content"> <div class="code"> <pre><code>//If the key pressed is 12,13,14,15, or 25 then If sum(Z={12,13,14,15,25:Then //Increase the CPS by the appropriate factor, if the user has enough cookies for it P+(1.01^H)(.1(Z=11)(C≥A)+(Z=12)(C≥B)+8(Z=13)(C≥D)+40(Z=14)(C≥E)+250(Z=15)(C≥F)+1ᴇ3(Z=25)(C≥G→P //Modify each of the prices based on the key pressed and if the user has enough cookies for it A+.2B(Z=11)(C≥A→A B+.2B(Z=12)(C≥B→B D+.2D(Z=13)(C≥D→D E+.2E(Z=14)(C≥E→E F+.2F(Z=15)(C≥F→F G+.2G(Z=25)(C≥G→G //Subtract the appropriate value from C, if the user has enough cookies for it C-A(Z=11)(C≥A)-B(Z=12)(C≥B)-D(Z=13)(C≥D)-E(Z=14)(C≥E)-F(Z=15)(C≥F)-G(Z=25)(C≥G→C ClrDraw End</code></pre></div> <br /> Feel free to DM me if you need more of an explanation</div> </div> </div> <hr /> <p>You can make most of your text statements based in a for loop, which will make the code shorter.</p> <p>Your Code:</p> <div class="code"> <pre><code>Text(16,1,&quot;CURSOR Text(22,1,&quot;GRANDMA Text(28,1,&quot;FARM Text(34,1,&quot;MINE Text(40,1,&quot;FACTORY Text(46,1,&quot;BANK Text(16,40,A Text(22,40,B Text(28,40,D Text(34,40,E Text(40,40,F Text(46,40,G Text(16,75,int(0.1(1.01^H)*10/10 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))</code></pre></div> <p>Can Be:</p> <div class="code"> <pre><code>For(I,1,6 Text(10+6I,1,sub(&quot;CURSOR GRANDMAFARM MINE FACTORYBANK &quot;,1+7(I-1),7 {A,B,D,E,F,G Text(10+6I,40,Ans(I {.1,1,8,40,250,1ᴇ3 Text(10+6I,75,int(Ans(I)1.01^H End //Just be sure to get the right number of spaces in the string</code></pre></div> <hr /> <p>I would also suggest adding something like the code below, so that users can exit the program without pressing the on button. You should probably also set up some sort of storage for the values when the game exits so that the game isn't reset every time it is started. I also noticed that you didn't have any graph modifications to turn off the axes or set the window size. Its probably a good idea to add those as well as a GDB to store and recall the user settings, cleaning up your variables.</p> <div class="code"> <pre><code>If Z=45:Goto E ... Lbl E ClrDraw ClrHome Return</code></pre></div> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-12842456#post-4436963</guid>
				<title>Re: 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#post-4436963</link>
				<description></description>
				<pubDate>Mon, 02 Dec 2019 22:46:45 +0000</pubDate>
								<wikidot:authorUserId>3338172</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Instead of storing the prices into several different variables, you can store them into <a href="http://tibasicdev.wikidot.com/lists">lists</a>. For example, instead of&#8230;</p> <div class="code"> <pre><code>15→A 100→B ...</code></pre></div> <p>You can do this instead.</p> <div class="code"> <pre><code>{0,10,100,1100,12000,130000,1400000}→L1 {Cookies,Curser,Grandma,Farm,Factory,Mine,etc.}</code></pre></div> <p>Where L1(element) recalls the element of a list.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-12842456#post-4436952</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#post-4436952</link>
				<description></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>
				</channel>
</rss>