shadowtide13 [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=66093 Calculator App for picotron v10! <p>In order to experiment with the Picotron v10 Gui library, I made this simple 4 op (more like 6 op) calculator! Just copy and paste the following code into a blank Picotron project and press ctrl+r!</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>gui = Gui() set_window(79,73) buttons = {} state = 0 a = 0.0 b = 0.0 op = nil buffer = &quot;&quot; function _init() for i=1,9,3 do for j=0,2 do add(buttons, gui:attach_button({label=tostr(i+j),x=j*16,y=(abs(i-9)/3)*14+8,bgcol=0x0d01,fgcol=0x070d,tap=function()add_buf(i+j)end})) end end add(buttons, gui:attach_button({label=&quot;0&quot;,x=0,y=59,bgcol=0x0d01,fgcol=0x070d,tap=function()add_buf(0)end})) add(buttons, gui:attach_button({label=&quot;.&quot;,x=16,y=59,bgcol=0x0d01,fgcol=0x070d,tap=function()add_buf(&quot;.&quot;)end})) add(buttons, gui:attach_button({label=&quot;=&quot;,x=32,y=59,bgcol=0x0902,fgcol=0x0209,tap=function()eval()end})) add(buttons, gui:attach_button({label=&quot;+&quot;,x=48,y=17,bgcol=0x0b03,fgcol=0x030b,tap=function()set_op(&quot;+&quot;)end})) add(buttons, gui:attach_button({label=&quot;-&quot;,x=48,y=31,bgcol=0x0b03,fgcol=0x030b,tap=function()set_op(&quot;-&quot;)end})) add(buttons, gui:attach_button({label=&quot;*&quot;,x=48,y=45,bgcol=0x0b03,fgcol=0x030b,tap=function()set_op(&quot;*&quot;)end})) add(buttons, gui:attach_button({label=&quot;/&quot;,x=48,y=59,bgcol=0x0b03,fgcol=0x030b,tap=function()set_op(&quot;/&quot;)end})) add(buttons, gui:attach_button({label=&quot;c&quot;,x=64,y=17,bgcol=0x0902,fgcol=0x0209,tap=function()clear()end})) add(buttons, gui:attach_button({label=&quot;^&quot;,x=64,y=31,bgcol=0x0b03,fgcol=0x030b,tap=function()set_op(&quot;^&quot;)end})) add(buttons, gui:attach_button({label=&quot;%&quot;,x=64,y=45,bgcol=0x0b03,fgcol=0x030b,tap=function()set_op(&quot;%&quot;)end})) add(buttons, gui:attach_button({label=&quot;_&quot;,x=64,y=59,bgcol=0x0d01,fgcol=0x070d,tap=function()inv()end})) end function _draw() gui:update_all() cls(n) if state==-1 then ?&quot;err&quot;,1,4,7 else ?buffer,1,4,7 end gui:draw_all() end function inv() buffer = tostr(buffer) if sub(buffer,1,1) != &quot;-&quot; then buffer = &quot;-&quot;..buffer else buffer = sub(buffer, 2) end end function add_buf(n) if(state==-1)state=0 buffer = buffer..n if(#buffer&gt;15)buffer=sub(buffer,1,15) end function set_op(n) if(state==-1)state=0 if state == 0 then a = buffer buffer = &quot;&quot; op = n state = 1 else state = -1 end end function eval() if state == 1 then b = buffer buffer = &quot;&quot; if op == &quot;+&quot; then buffer = a + b elseif op == &quot;-&quot; then buffer = a - b elseif op == &quot;*&quot; then buffer = a * b elseif op == &quot;/&quot; then buffer = a / b elseif op == &quot;^&quot; then buffer = a ^ b elseif op == &quot;%&quot; then buffer = a % b end state = 0 end end function clear() if buffer == &quot;&quot; then op = nil a = 0.0 b = 0.0 state = 0 else buffer = &quot;&quot; end end</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> https://www.lexaloffle.com/bbs/?tid=52990 https://www.lexaloffle.com/bbs/?tid=52990 Mon, 05 Jun 2023 19:21:38 UTC Logarithm Benchmark <h1>Logarithm Benchmark</h1> <p> <table><tr><td> <a href="/bbs/?pid=130462#p"> <img src="/bbs/thumbs/pico8_log_bench-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=130462#p"> log_bench</a><br><br> by <a href="/bbs/?uid=66093"> shadowtide13</a> <br><br><br> <a href="/bbs/?pid=130462#p"> [Click to Play]</a> </td></tr></table> </p> <h1>Logarithm algorithms</h1> <h2>wiki method</h2> <h3>stats</h3> <p><em>tokens</em>:46</p> <h3>description</h3> <p>the wiki method uses an interesting property of logarithms to compute a value. specifically:<br /> <em>log(A * B) = log(A) + log(B)</em><br /> by using a look up table for all the logarithms (base 10 of course) of the first 9 digits (1-9) we can use the following code to compute logarithms:</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>log10_table = { 0, 0.3, 0.475, 0.6, 0.7, 0.775, 0.8375, 0.9, 0.95, 1 } function log10(n) if (n &lt; 1) return nil local t = 0 while n &gt; 10 do n /= 10 t += 1 end return log10_table[flr(n)] + t end</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>what this algorithm actually does is repeatedly divide by 10 and add the number of times it does this to a counter. Essentially we are assuming the number <em>n</em> can be expressed as <em>m * 10 *10 *10...</em> and we are simply removing these tens. then re-adding them in at the end.</p> <h2>extended wiki method</h2> <h3>stats</h3> <p><em>tokens</em>:98 (can probably be improved easily)</p> <h3>description</h3> <p>its the same thing but we use the following properties to extend the domain of the function:<br /> <em>log base n of m = log base 10 of n / log base 10 of m</em><br /> <em>log(n)=log(A)-log(A/n)</em> when 0 &lt; n &lt; 1</p> <h2>my method</h2> <h3>stats</h3> <p><em>tokens</em>:118</p> <h3>description</h3> <p>I simply test 'all' the possible digits and calculate the error. then take the digit with the lowest error then I move on to test the next digit. Effectivly a brute force method.<br /> The code:</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>function log(n,m) assert(n&gt;0and m&gt;0and m!=1) if(m&lt;1)return log(n,10)/log(m,10) if(n&lt;1)return -log(1/n,m) local g,cur,err='0000.0000',g,9999 for i=1,9do if i!=5then for j=0,9do cur=sub(g,1,i-1)..j..sub(g,i+1) local c=m^tonum(cur)-n if abs(c)&lt; err and c&lt;=0then g,err=cur,abs(c) end end end end return tonum(g) end</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> https://www.lexaloffle.com/bbs/?tid=52964 https://www.lexaloffle.com/bbs/?tid=52964 Fri, 02 Jun 2023 15:49:17 UTC Goats, Cars and doors <h1>Goats, Cars n' Doors!</h1> <p> <table><tr><td> <a href="/bbs/?pid=124504#p"> <img src="/bbs/thumbs/pico8_goats_cars_doors-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=124504#p"> goats_cars_doors</a><br><br> by <a href="/bbs/?uid=66093"> shadowtide13</a> <br><br><br> <a href="/bbs/?pid=124504#p"> [Click to Play]</a> </td></tr></table> </p> <h2>So...</h2> <p>the situation being proposed is: there are 3 doors, behind 2 of them are goats the other has a new car. you (trying to get the car) pick a door, the host stops you and opens a different door. behind that door is a goat. they then ask you &quot;do you switch your answer&quot;.</p> <p>the question: what are the odds of getting that car if you switch vs. not switching.</p> <p>the problem: everyone i've asked has said its a 50% chance either way, but the answer is actually 2/3 if you switch. why? I have no idea but I built a simulation so you can answer that yourself!</p> https://www.lexaloffle.com/bbs/?tid=51242 https://www.lexaloffle.com/bbs/?tid=51242 Wed, 18 Jan 2023 13:41:27 UTC War! v1.0 <p> <table><tr><td> <a href="/bbs/?pid=122346#p"> <img src="/bbs/thumbs/pico8_kofajemop-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=122346#p"> War! v1.0</a><br><br> by <a href="/bbs/?uid=66093"> shadowtide13</a> <br><br><br> <a href="/bbs/?pid=122346#p"> [Click to Play]</a> </td></tr></table> </p> <p>Its War!<br /> Just press Z... that's it.<br /> This cartridge was mostly to make a quick n' dirty card library and use it in practice.</p> <p>You can enable/disable auto mode in the pause menu (auto mode stops when a game ends).<br /> When you finish a game you can press X to start a new game.</p> https://www.lexaloffle.com/bbs/?tid=50637 https://www.lexaloffle.com/bbs/?tid=50637 Tue, 13 Dec 2022 20:05:49 UTC Boat zeta <p> <table><tr><td> <a href="/bbs/?pid=118434#p"> <img src="/bbs/thumbs/pico8_boat_zeta_0-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=118434#p"> boat_zeta_0</a><br><br> by <a href="/bbs/?uid=66093"> shadowtide13</a> <br><br><br> <a href="/bbs/?pid=118434#p"> [Click to Play]</a> </td></tr></table> </p> <h1>BOAT ZETA!</h1> <p>This is a little remake of Yahtzee I made a while ago, it was a little janky and broken but I decided to fix it up and post it. not much but it works!</p> <p>If you notice any bugs or have any advice, I encourage you to tell me!</p> https://www.lexaloffle.com/bbs/?tid=49604 https://www.lexaloffle.com/bbs/?tid=49604 Mon, 03 Oct 2022 15:15:32 UTC Type writer <p> <table><tr><td> <a href="/bbs/?pid=112889#p"> <img src="/bbs/thumbs/pico8_typewriter-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=112889#p"> typewriter</a><br><br> by <a href="/bbs/?uid=66093"> shadowtide13</a> <br><br><br> <a href="/bbs/?pid=112889#p"> [Click to Play]</a> </td></tr></table> </p> <h2>ITS... a typewriter</h2> <p>so I made this after spending an unhealthy amount of time in google docs.<br /> Enjoy spending your time typing in this program, it really has no practical use.</p> <h3>CONTROLS</h3> <p>⬅️/⬆️/➡️/⬇️: move the 'cursor'<br /> 🅾️: type the symbol<br /> the green arrow is \n or newline<br /> the red arrow is backspace<br /> the yellow... thing is space bar<br /> and the colored squares switch what characters are available (like upper and lower case)</p> <p>There is a total of 4 character palettes, I encourage you guys to see if you can expand the palettes even more. it also supports special characters found using CHR().</p> <p>Also if you find any bugs, I encourage you report them!</p> https://www.lexaloffle.com/bbs/?tid=48068 https://www.lexaloffle.com/bbs/?tid=48068 Wed, 08 Jun 2022 14:53:31 UTC Butterpan v1 <h1>BUTTERPAN [v1.0.0]</h1> <p> <table><tr><td> <a href="/bbs/?pid=112057#p"> <img src="/bbs/thumbs/pico8_butterpan_v1-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=112057#p"> Butterpan v1</a><br><br> by <a href="/bbs/?uid=66093"> shadowtide13</a> <br><br><br> <a href="/bbs/?pid=112057#p"> [Click to Play]</a> </td></tr></table> </p> <h2>STORY</h2> <p>Its Butterpan! Join butter boy on his slippery adventure. try not to melt while gathering all the coins and gems! But watch out! Sometimes the pan gets really hot or someone drops a crab into the pan! See how high of a score you can get!</p> <h2>CONTROLS</h2> <p>arrow keys to move<br /> [o] button to dash<br /> [x] button to shoot hot butter<br /> the meter on the right is how much butter you have left, if it drops to zero you lose.</p> <h3>Extras</h3> <p>this is my first pico-8 cartridge! I could use some feed back on the game and its game play. Have fun! (my personal best score is something like 5000 points)</p> https://www.lexaloffle.com/bbs/?tid=47865 https://www.lexaloffle.com/bbs/?tid=47865 Thu, 19 May 2022 21:45:47 UTC