shiftalow [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=32759 Binary export cart startup failure on M1Mac <p>Hello <a href="https://www.lexaloffle.com/bbs/?uid=1"> @zep</a> </p> <p>One of my game players reported this.<br /> It seems that Pico8 games downloaded from Steam sometimes fail to start when a controller is connected.</p> <h3>Target game in which the bug occurred.</h3> <p><a href="https://store.steampowered.com/app/1448220/KONSAIRI/">https://store.steampowered.com/app/1448220/KONSAIRI/</a></p> <h3>Running environment</h3> <ul> <li>Apple silicon Mac.</li> <li>Gamepad &quot;Sony PlayStation&reg; DualSense&trade; Wireless Controller&quot; ----<a href="https://www.apple.com/jp/shop/product/HPNG2J/A/sony-playstation-dualsense%E2%84%A2%E3%83%AF%E3%82%A4%E3%83%A4%E3%83%AC%E3%82%B9%E3%82%B3%E3%83%B3%E3%83%88%E3%83%AD%E3%83%BC%E3%83%A9">STORE PAGE</a>.</li> <li>Using Steam's controller linkage function (Bluetooth).</li> <li>Exported cart pico8 version 0.2.2c (also occurs in 0.2.5e)</li> </ul> <h3>Crash report</h3> <p><a href="https://docs.google.com/document/d/1u615ThHWhl_YEK8agfgb5EENnyzfXKkhnk_ach4XDgA/edit?usp=sharing">https://docs.google.com/document/d/1u615ThHWhl_YEK8agfgb5EENnyzfXKkhnk_ach4XDgA/edit?usp=sharing</a></p> <p>Thank you for your cooperation.</p> https://www.lexaloffle.com/bbs/?tid=50998 https://www.lexaloffle.com/bbs/?tid=50998 Mon, 09 Jan 2023 08:37:41 UTC The pause menu is not shown in the screenshot.(v0.2.5c) <p>In the screenshot, the pause menu does not appear.</p> <p>But in the case of GIF output, the pause menu seems to appear.<br /> (version 0.2.5c)</p> <img style="margin-bottom:16px" border=0 src="/media/32759/instantload_3.gif" alt="" /> https://www.lexaloffle.com/bbs/?tid=32409 https://www.lexaloffle.com/bbs/?tid=32409 Fri, 09 Dec 2022 12:06:06 UTC BPACK() [Pack with bit value. (different bit widths supported)] <p> <table><tr><td> <a href="/bbs/?pid=59572#p"> <img src="/bbs/thumbs/pico8_knutil_bpack-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=59572#p"> knutil_bpack</a><br><br> by <a href="/bbs/?uid=32759"> shiftalow</a> <br><br><br> <a href="/bbs/?pid=59572#p"> [Click to Play]</a> </td></tr></table> </p> <h2>Feature Overview</h2> <p>BPACK() pack the value of the bit specification with bit width.</p> <ul> <li>By packs in the direction of low bits when multiple bit values are specified.</li> <li>By setting [number s] to a negative value, bit pack can be started from the decimal point.</li> <li>If there are fewer bit-width elements relative to the value to be packed, the bit-width elements are rotated.</li> <li>This function consumes 37 Token.</li> </ul> <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> v=bpack({8,4},0,0xff,0xb) ?tostr(v,1) -- 0x00ff.b000 (bit-left-shift:0) v=bpack({8,4},8,0xff,0xb) ?tostr(v,1) -- 0xffb0.0000 (bit-left-shift:8) </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>This function is included in the <a href="https://www.lexaloffle.com/bbs/?tid=32411">KNUTIL</a> library.</p> <h3>release note</h3> <p><div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"><br /> <strong>v0.1</strong></p> <ul> <li>first release<br /> </div></div></div></li> </ul> https://www.lexaloffle.com/bbs/?tid=32418 https://www.lexaloffle.com/bbs/?tid=32418 Thu, 01 Dec 2022 13:18:51 UTC BUNPACK() [The bit value slice and unpack] <p> <table><tr><td> <a href="/bbs/?pid=121616#p"> <img src="/bbs/thumbs/pico8_knutil_bunpack-2.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=121616#p"> knutil_bunpack</a><br><br> by <a href="/bbs/?uid=32759"> shiftalow</a> <br><br><br> <a href="/bbs/?pid=121616#p"> [Click to Play]</a> </td></tr></table> </p> <h2>Feature Overview</h2> <p>BUNPACK() slice the value with bit width.</p> <ul> <li>By specifying the argument after [number w], a value of up to 32 bits can be sliced.</li> <li>By setting [number s] to a negative value, bit slice can be started from the decimal point.</li> <li>This function consumes 30 Token.</li> </ul> <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> a,b=bunpack(0xf8,4,4,4) -- Value, First bit-shift, bit-width, ...[bit-width] ?a -- 15 (0xf) ?b -- 8 (0x8) </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>This function is included in the <a href="https://www.lexaloffle.com/bbs/?tid=32411">KNUTIL</a> library.</p> <h3>release note</h3> <p><div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"><br /> <strong>v0.1</strong></p> <ul> <li>first release<br /> </div></div></div></li> </ul> https://www.lexaloffle.com/bbs/?tid=50425 https://www.lexaloffle.com/bbs/?tid=50425 Wed, 30 Nov 2022 12:12:38 UTC TBFILL() [Table fill, Multi-dimensional table support] <p> <table><tr><td> <a href="/bbs/?pid=59934#p"> <img src="/bbs/thumbs/pico8_knutil_tbfill-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=59934#p"> knutil_tbfill</a><br><br> by <a href="/bbs/?uid=32759"> shiftalow</a> <br><br><br> <a href="/bbs/?pid=59934#p"> [Click to Play]</a> </td></tr></table> </p> <h2>Feature Overview</h2> <p>TBFILL() Create a table by specifying an index number.</p> <ul> <li>Create the table with the specified minimum and maximum indices and fill it with the value of the first argument.</li> <li>Multi-dimensional tables can be created by adding minimum and maximum arguments.</li> <li>This function consumes 30 Token.</li> </ul> <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>-- one-dimensional table t=tbfill('yes',1,3) ?t[1]..' '..t[2]..' '..t[3]..&quot;\n\n&quot; -- two-dimensional table t=tbfill('yes',1,2,1,3) t[2][2]='no' ?t[1][1]..' '..t[1][2]..' '..t[1][3] ?t[2][1]..' '..t[2][2]..' '..t[2][3] </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>This function is included in the <a href="https://www.lexaloffle.com/bbs/?tid=32411">KNUTIL</a> library.</p> <h3>release note</h3> <p><div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"><br /> <strong>v0.3</strong></p> <ul> <li>changed to specify elements for table start and end, variable length arguments supported</li> </ul> <p><strong>v0.2</strong></p> <ul> <li>defaults to 1 or specifies the start of the table</li> </ul> <p><strong>v0.1</strong></p> <ul> <li>first release<br /> </div></div></div></li> </ul> https://www.lexaloffle.com/bbs/?tid=32541 https://www.lexaloffle.com/bbs/?tid=32541 Mon, 12 Sep 2022 09:27:07 UTC JOIN()[Join strings with a delimiter] <p> <table><tr><td> <a href="/bbs/?pid=59961#p"> <img src="/bbs/thumbs/pico8_knutil_join-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=59961#p"> knutil_join</a><br><br> by <a href="/bbs/?uid=32759"> shiftalow</a> <br><br><br> <a href="/bbs/?pid=59961#p"> [Click to Play]</a> </td></tr></table> </p> <h2>Feature Overview</h2> <p>JOIN() Join strings with a delimiter.</p> <ul> <li>Joins the argument strings with the specified delimiter.</li> <li>This function consumes 25 Token.</li> </ul> <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> ?join('====','----','----','----','----\n') ?join(' ',unpack({'test','[join]','is','ok!\n\n'})) ?join('\fa◆\f6','c','o','m','p','l','e','t','e\n') ?join('\-e=\-e',unpack(split('----------------------------',''))) </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>This function is included in the <a href="https://www.lexaloffle.com/bbs/?tid=32411">KNUTIL</a> library.</p> <h3>release note</h3> <p><div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"><br /> <strong>v0.2</strong></p> <ul> <li>variable argument support by tuple</li> </ul> <p><strong>v0.1</strong></p> <ul> <li>first release<br /> </div></div></div></li> </ul> https://www.lexaloffle.com/bbs/?tid=32551 https://www.lexaloffle.com/bbs/?tid=32551 Sat, 10 Sep 2022 15:45:26 UTC TTABLE() [TRUE returns it as a table, and makes a TABLE judgment] <p> <table><tr><td> <a href="/bbs/?pid=60009#p"> <img src="/bbs/thumbs/pico8_knutil_ttable-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=60009#p"> knutil_ttable</a><br><br> by <a href="/bbs/?uid=32759"> shiftalow</a> <br><br><br> <a href="/bbs/?pid=60009#p"> [Click to Play]</a> </td></tr></table> </p> <h2>Feature Overview</h2> <p>TTABLE() returns the table if the argument is a table.</p> <ul> <li>Returns FALSE if not a table.</li> <li>Use when table or string determination is required. <ul> <li>e.g., when using a string for initialization and replacing it with a table</li> <li>Simultaneously check the type and reference the contents inline, as in <code>type(tbl)=='table' and tbl</code>.</li> </ul></li> <li>This function consumes 12 Token.</li> </ul> <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>tbl = '1 5 10' -- Default value. tbl = ttable(tbl) or split(tbl, ' ') -- tbl = {1, 5, 10} ---- ---- -- Thereafter, the tbl is not initialized even if there are changes to the elements of the tbl. tbl = ttable(tbl) or split(tbl, ' ') </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>This function is included in the <a href="https://www.lexaloffle.com/bbs/?tid=32411">KNUTIL</a> library.</p> <h3>release note</h3> <p><div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"><br /> v0.1</p> <ul> <li>first release</li> </ul> <p></div></div></div></p> https://www.lexaloffle.com/bbs/?tid=32573 https://www.lexaloffle.com/bbs/?tid=32573 Sun, 28 Aug 2022 06:03:25 UTC REPLACE() [Perform string substitutions] <p> <table><tr><td> <a href="/bbs/?pid=60157#p"> <img src="/bbs/thumbs/pico8_knutil_replace-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=60157#p"> knutil_replace</a><br><br> by <a href="/bbs/?uid=32759"> shiftalow</a> <br><br><br> <a href="/bbs/?pid=60157#p"> [Click to Play]</a> </td></tr></table> </p> <h2>Feature Overview</h2> <p>REPLACE() Replaces the specified string with the specified string.</p> <ul> <li>The first argument string replaces all matches to the second argument string with the third argument string.</li> <li>This function consumes 53 Token.</li> </ul> <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>--&quot;str&quot; becomes &quot;string for replace&quot;. str = replace('[test] for replace', '[test]', 'string') </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>This function is included in the <a href="https://www.lexaloffle.com/bbs/?tid=32411">KNUTIL</a> library.</p> <h3>release note</h3> <p><div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"><br /> v0.1</p> <ul> <li>first release</li> </ul> <p></div></div></div></p> https://www.lexaloffle.com/bbs/?tid=32640 https://www.lexaloffle.com/bbs/?tid=32640 Mon, 15 Aug 2022 08:06:19 UTC SUM() <p> <table><tr><td> <a href="/bbs/?pid=63121#p"> <img src="/bbs/thumbs/pico8_tuple_sum-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=63121#p"> tuple_sum</a><br><br> by <a href="/bbs/?uid=32759"> shiftalow</a> <br><br><br> <a href="/bbs/?pid=63121#p"> [Click to Play]</a> </td></tr></table> </p> <h2>Feature Overview</h2> <p>SUM() returns the sum of the numbers in the given arguments.</p> <ul> <li>If the argument contains nil or false, the result will not be correct.</li> <li>If too many arguments are given, Out of memory is returned. (In the sample, up to 710 arguments)</li> <li>This function consumes 15 Token.</li> </ul> <hr /> <p><strong>If you are concerned about some of the problems, consider using the &quot;More Argments Ver&quot; code.</strong><br /> <div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"></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>--more argments ver(17 token) function sum(a,...) foreach({...},function(v) a+=v end) return a 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></div></div></div></p> <p>Other tuple trick code: <a href="https://www.lexaloffle.com/bbs/?tid=35802">INRNG()</a></p> https://www.lexaloffle.com/bbs/?tid=33754 https://www.lexaloffle.com/bbs/?tid=33754 Tue, 26 Jul 2022 09:26:13 UTC konsairi_bgm_darkness06 <p> <iframe src="sfxp.php?id=32759_1" width="769" height="97" style="border:none; overflow:hidden"></iframe><a style="cursor:pointer; font-size:8pt" onclick=' var el = document.getElementById("sfxcode_32759_1"); if (el.style.display == "none") el.style.display = ""; else el.style.display = "none"; microAjax("/bbs/sfxc/32759_1.txt", function (retdata){ var el = document.getElementById("sfxcode_32759_1"); el.innerHTML = retdata; el.focus(); el.select(); } ); '> [sfx] </a> <textarea rows=3 class=lexinput id="sfxcode_32759_1" style="width:480px;background-color:#fed;display:none;overflow:hidden; font-size:4pt;"></textarea> </p> <img style="margin-bottom:16px" border=0 src="/media/32759/2_2.gif" alt="" /> <p>This is one of the pieces of music played in my own game. ☺</p> https://www.lexaloffle.com/bbs/?tid=33756 https://www.lexaloffle.com/bbs/?tid=33756 Fri, 08 Jul 2022 02:19:49 UTC INRNG() [Test that the value is within a range] <p> <table><tr><td> <a href="/bbs/?pid=69481#p"> <img src="/bbs/thumbs/pico8_knutil_inrng-2.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=69481#p"> knutil_inrng</a><br><br> by <a href="/bbs/?uid=32759"> shiftalow</a> <br><br><br> <a href="/bbs/?pid=69481#p"> [Click to Play]</a> </td></tr></table> </p> <h2>Feature Overview</h2> <p>INRNG() Tests if the value is between the lowest and highest values.</p> <ul> <li>Tests that the specified value is within a range.</li> <li>This function consumes 10 Token.</li> </ul> <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>--[true] in range value inrng(5,1,10) --[true] lowest range value inrng(1,1,10) --[true] highest range value inrng(10,1,10) --[false] out of range value inrng(0,1,10) --Player:1 any key inrng(btn(),0x1,0xff) --Player:2 any key inrng(btn(),0x100,0xff00) </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>This function is included in the <a href="https://www.lexaloffle.com/bbs/?tid=32411">KNUTIL</a> library.</p> <h3>release note</h3> <p><div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"><br /> v0.2</p> <ul> <li>change arguments to a tuple</li> </ul> <p>v0.1</p> <ul> <li>first release</li> </ul> <p></div></div></div></p> https://www.lexaloffle.com/bbs/?tid=35802 https://www.lexaloffle.com/bbs/?tid=35802 Thu, 30 Jun 2022 01:57:55 UTC &quot;One-off characters&quot; prints unnaturally. <img style="margin-bottom:16px" border=0 src="/media/32759/p8scii_oneofee0.png" alt="" /> <p>One-off characters [8 chars of raw binary data] print unnaturally.</p> <p>Or I may not understand this feature.<br /> I was aware that &quot;\^.00000000&quot; would print nothing.</p> https://www.lexaloffle.com/bbs/?tid=36343 https://www.lexaloffle.com/bbs/?tid=36343 Sun, 17 Apr 2022 12:38:07 UTC Crashes with Tab stop controll code <p>Setting Tab stop controll code to 0 and outputting tab characters at the same time causes pico-8 crash.</p> <p>pico-8 version:0.2.4b</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>print(&quot;\^s0\t&quot;)</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=36573 https://www.lexaloffle.com/bbs/?tid=36573 Tue, 05 Apr 2022 13:53:20 UTC RCEACH()[Iterate from rectangle values] <p> <table><tr><td> <a href="/bbs/?pid=72450#p"> <img src="/bbs/thumbs/pico8_rceach-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=72450#p"> rceach</a><br><br> by <a href="/bbs/?uid=32759"> shiftalow</a> <br><br><br> <a href="/bbs/?pid=72450#p"> [Click to Play]</a> </td></tr></table> </p> <h2>Feature Overview</h2> <p>RCEACH() performs a two-dimensional loop in a single function.</p> <ul> <li>The rectangle value arguments correspond to [table] {x,y,w,h} and [string] &quot;x y w h&quot;.</li> <li>You can refer to the current x and y values in the specified function.</li> <li>This function consumes 50 Token.</li> </ul> <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>rceach({16,16,32,32},function(x,y,r) local c=(x+y)%8+8 pset(x,y,c) 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>One of KNUTIL's functions, the object generated by EXRECT(), has a rectangle value format to be used for the RCEACH() argument.<br /> may want to Use <a href="https://www.lexaloffle.com/bbs/?tid=32830">DMP()</a> if check the converted table.<br /> This function is included in the <a href="https://www.lexaloffle.com/bbs/?tid=32411">KNUTIL</a> library.</p> https://www.lexaloffle.com/bbs/?tid=36681 https://www.lexaloffle.com/bbs/?tid=36681 Wed, 30 Mar 2022 10:32:02 UTC TMAP()[More flexible foreach()] <p> <table><tr><td> <a href="/bbs/?pid=77195#p"> <img src="/bbs/thumbs/pico8_tablemap-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=77195#p"> table_map</a><br><br> by <a href="/bbs/?uid=32759"> shiftalow</a> <br><br><br> <a href="/bbs/?pid=77195#p"> [Click to Play]</a> </td></tr></table> </p> <h2>Feature Overview</h2> <p>TMAP(), like foreach(), applies the function of the second argument to each element of the table.</p> <ul> <li>Usage is almost the same as foreach(), plus index values can be referenced within the function.</li> <li>The specified table is returned. (TMAP() nested functions can be applied multiply)</li> <li>The return value in the function specified in the argument can update each element of the table.</li> <li>This function consumes 27 Token.</li> </ul> <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>local t={ 'toast' ,'letus' ,'bacon' ,'cheese' } t=tmap(t, function(v,i) ?i..'..'..v end) -------- t=tmap(t, function(v,i) v='super★'..v ?i..'..'..v return v end) -------- t=tmap({ 'shield' ,'armor' ,'sword' ,'ring' }, function(v,i) v=t[i]..'&bull;'..v ?i..'..'..v return v 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>may want to Use <a href="https://www.lexaloffle.com/bbs/?tid=32830">DMP()</a> if check the converted table.<br /> This function is included in the <a href="https://www.lexaloffle.com/bbs/?tid=32411">KNUTIL</a> library.</p> https://www.lexaloffle.com/bbs/?tid=38126 https://www.lexaloffle.com/bbs/?tid=38126 Mon, 21 Mar 2022 08:51:22 UTC COMB()[Combine tables] <p> <table><tr><td> <a href="/bbs/?pid=108664#p"> <img src="/bbs/thumbs/pico8_combine_table-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=108664#p"> combine_table</a><br><br> by <a href="/bbs/?uid=32759"> shiftalow</a> <br><br><br> <a href="/bbs/?pid=108664#p"> [Click to Play]</a> </td></tr></table> </p> <h2>Feature Overview</h2> <p>COMB() combines two tables to create a hash table.</p> <ul> <li>Returns the joined table.</li> <li>The two arguments must be tables of index arrays.</li> <li>The argument is nondestructive.</li> <li>Hash tables are not in constant order. (This is a Lua specification.)</li> <li>This function consumes 26 Token.</li> </ul> <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>local keys={'name','species','home','skill'} local values={'ruth','fox','port town','kon-psi'} local charcter=comb(keys,values)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>may want to Use <a href="https://www.lexaloffle.com/bbs/?tid=32830">DMP()</a> if check the converted table.<br /> This function is included in the <a href="https://www.lexaloffle.com/bbs/?tid=32411">KNUTIL</a> library.</p> https://www.lexaloffle.com/bbs/?tid=46985 https://www.lexaloffle.com/bbs/?tid=46985 Tue, 15 Mar 2022 14:40:26 UTC CAT() [Concat Table] <p> <table><tr><td> <a href="/bbs/?pid=88288#p"> <img src="/bbs/thumbs/pico8_concat___table-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=88288#p"> concat___table</a><br><br> by <a href="/bbs/?uid=32759"> shiftalow</a> <br><br><br> <a href="/bbs/?pid=88288#p"> [Click to Play]</a> </td></tr></table> </p> <h2>Feature Overview</h2> <p>CAT() concatenates two or more tables.</p> <ul> <li>The second and subsequent arguments are added to the table elements of the first argument.</li> <li>Returns a concatenated table.</li> <li>The table used for the first argument is updated. (destructive)</li> <li>This function consumes 39 Token.</li> </ul> <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>local tbl_1 = {'a'} local tbl_2 = {'b', 'c'} cat(tbl_1, tbl_2) ?tbl_1[1] -- a ?tbl_1[2] -- b ?tbl_1[3] -- c -- Only primary elements can be cloned by specifying an empty table for the first argument. local tbl = {1, 2, 3} local tbl_dup = cat({}, tbl) tbl[1] = 256 ?tbl_dup[1] -- 1 ?tbl_dup[2] -- 2 ?tbl_dup[3] -- 3 </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>See the code in the cartridge for further examples.</p> <p>may want to Use <a href="https://www.lexaloffle.com/bbs/?tid=32830">VDMP()</a> if check the converted table.<br /> This function is included in the <a href="https://www.lexaloffle.com/bbs/?tid=32411">KNUTIL</a> library.</p> https://www.lexaloffle.com/bbs/?tid=41798 https://www.lexaloffle.com/bbs/?tid=41798 Fri, 11 Mar 2022 14:12:28 UTC Feature request: copying SFX from the clipboard <p>Hello. </p> <p>I want to use the clipboard to paste SFX data to another console as shown in the image below.<br /> With the current (0.2.4b) function of PICO-8, you can only paste SFX data on the same console.<br /> It would be simpler to share sound effects if they could be pasted to the clipboard in a format like<br /> <code>[gfx] wwhhpp... [/gfx)</code></p> <img style="margin-bottom:16px" border=0 src="/media/32759/04c6be65e48425a0f764f371eb89c57d.gif" alt="" /> https://www.lexaloffle.com/bbs/?tid=46736 https://www.lexaloffle.com/bbs/?tid=46736 Sun, 27 Feb 2022 15:26:39 UTC Return value when tonum() cannot convert hexadecimal numbers <p>In what situations do you use these conversions?</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>hexnumber = '3xz' --A tonum(hexnumber,1) : 768 (0x0300.0000) --B tonum(&quot;0x&quot;..hexnumber,4) : 0 (0x0000.0000) --C tonum('0x'..hexnumber) : -- NO VALUE --([nil])</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p><strong>Example</strong><br /> I want &quot;nil&quot; to be returned when I use a character as an identifier. Therefore, I use the &quot;C&quot; conversion.</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>hexstr = '108000789$' hexval = TONORM(hexstr) -- Normalize the value [number boolian nil], otherwise it remains a string. hextable = {} if type(hexval) == 'string' then foreach(split(hexstr, 3), function(v) add(hextable, tonum('0x' .. v)) end) end -- Handle hexadecimal conversions without being converted to numbers by normalization. -- Only the value of number is stored in the hextable. -- &quot;$&quot; is not stored. </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=42448 https://www.lexaloffle.com/bbs/?tid=42448 Thu, 24 Feb 2022 10:36:55 UTC Using more than two characters in split() <p>I noticed that split() splits the table at the first character if you use a separator of more than two characters.<br /> Is it a bug or a specification that split() cannot be used with separators of more than two characters?</p> <img style="margin-bottom:16px" border=0 src="/media/32759/split_2chr.png" alt="" /> <p>Thank you.</p> <p><div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"><br /> If there is no limit to the number of characters in the separator, string replacement can be implemented in a compact way. (as in replace_short())</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 replace_short(s,f,r) return join(split(s,f),r or '') end -- join() is custom function function replace(s,f,r) local a='' while #s&gt;0 do local t=sub(s,1,#f) a=a..(t~=f and sub(s,1,1) or r or '') s=sub(s,t==f and 1+#f or 2) end return a 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></div></div></div></p> https://www.lexaloffle.com/bbs/?tid=46617 https://www.lexaloffle.com/bbs/?tid=46617 Thu, 17 Feb 2022 13:37:57 UTC