arnaught [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=92431 Printing Special Characters <p>I figured out how to get the Pico8 special characters (the ones you get when typing capitals) in Picotron. The special characters start at U+0080 and go all the way up to U+0099. All unknown characters seem to display the same.</p> <img style="margin-bottom:16px" border=0 src="/media/92431/Screenshot from 2024-03-26 00-33-35.png" alt="" /> <p>I don't know of a convenient way to type these into picotron, but if you copy paste the list below, you can save them to a text file for reference. It's a little annoying because none of them are actually printable characters. UTF-8 doesn't seem to like having them bare, so when you copy paste, it will actually be <code>U+00C2 U+0080</code> instead of just <code>U+0080</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>A: € B:  C: ‚ D: ƒ E: „ F: … G: † H: ‡ I: ˆ J: ‰ K: Š L: ‹ M: Œ N:  O: Ž P:  Q:  R: ‘ S: ’ T: “ U: ” V: • W: – X: — Y: ˜ Z: ™ Unknown: &Acirc;</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=141097 https://www.lexaloffle.com/bbs/?tid=141097 Tue, 26 Mar 2024 04:32:04 UTC Magic 8 Ball <p> <table><tr><td> <a href="/bbs/?pid=144300#p"> <img src="/bbs/thumbs/pico64_magic8ball-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=144300#p"> magic8ball</a><br><br> by <a href="/bbs/?uid=92431"> arnaught</a> <br><br><br> <a href="/bbs/?pid=144300#p"> [Click to Play]</a> </td></tr></table> </p> <p>This Picotron cartridge can predict the future! Simply ask it any yes or no question, shake the window, and you'll get your answer!</p> <p>(I hear you can also press <code>z</code> to get an answer, but that seems less fun than shaking the window.)</p> <hr /> <p>This was a fun little project to make. I finally figured out how to edit the cartridge's metadata! (Though I'm still not sure how to do it on a fullscreen cartridge).</p> <p>I wanted to put a sound effect when shaking the window, but I have no idea how to work the instrument editor lol.</p> https://www.lexaloffle.com/bbs/?tid=141052 https://www.lexaloffle.com/bbs/?tid=141052 Sun, 24 Mar 2024 15:03:28 UTC Startup Folder <p>Some linux distros include code in the default <code>.bashrc</code> that chain loads files from <code>~/.bashrc.d</code>. This is useful for keeping your config organized. (I like keeping my aliases in a separate file, for instance.)</p> <p>I've made a snippet that does this for Picotron. Add this to your <code>/appdata/system/startup.lua</code>, and it will chain load any .lua files in the folder <code>/appdata/system/startup</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>startup_folder = &quot;/appdata/system/startup&quot; if fstat(startup_folder) == &quot;folder&quot; then for file in all(ls(startup_folder)) do filename = startup_folder .. &quot;/&quot; .. file if fstat(filename) == &quot;file&quot; and file:find(&quot;%.lua$&quot;) then create_process(filename) end 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=140999 https://www.lexaloffle.com/bbs/?tid=140999 Fri, 22 Mar 2024 18:14:23 UTC Pipes <p> <table><tr><td> <a href="/bbs/?pid=143829#p"> <img src="/bbs/thumbs/pico64_pipes-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=143829#p"> Pipes 1.0</a><br><br> by <a href="/bbs/?uid=92431"> arnaught</a> <br><br><br> <a href="/bbs/?pid=143829#p"> [Click to Play]</a> </td></tr></table> </p> <p>I made a pipes screensaver, inspired by the classic <a href="https://www.youtube.com/watch?v=MKqrLGFoK9E">3D Pipes Screensaver</a>.</p> <p>A pipe of a random color is created on the somewhere on the edge of the screen. It will expand outwards from its starting point, choosing to go straight, left, or right. The pipe will stop when it goes out of bounds, and a new pipe will be created.</p> <p>I am not saving information about the pipes manually. I just draw the current pipe, and never <code>cls</code>. All the old pipes stay on screen and the new ones are drawn above. Previously, I saved all of the pipe connections and colors in a 30*17*6 table which was redrawn every frame, but then I realized that I could get rid of that by just removing <code>cls</code>. So instead of storing and drawing up to 3060 sprites every frame, instead I only store and draw one.</p> <p>I only have 3 pipe sprites for each color: a vertical pipe, a horizontal pipe, and a bend pipe. The bend pipe is flipped based on what direction it needs to be. There is a visual bug when flipping a pipe vertically on the bottom row (y = 256) that causes it to become misaligned with the rest. I <em>think</em> it's a bug with the sprite flipping so there's no way I can fix it. (Well, there is a way I can fix it, and it's called quadruple the number of bend sprites. But I'm not doing that.)</p> <p>(Edit: The sprite flipping issue was fixed in 0.1.0c!)</p> <p>The pipe only expands once every 8 frames. I think at full speed it goes too fast to watch it.</p> https://www.lexaloffle.com/bbs/?tid=140903 https://www.lexaloffle.com/bbs/?tid=140903 Tue, 19 Mar 2024 14:17:47 UTC Mastodon Client <p> <table><tr><td> <a href="/bbs/?pid=143734#p"> <img src="/bbs/thumbs/pico64_r01mastodon-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=143734#p"> r01mastodon</a><br><br> by <a href="/bbs/?uid=92431"> arnaught</a> <br><br><br> <a href="/bbs/?pid=143734#p"> [Click to Play]</a> </td></tr></table> </p> <h1>Mastodon</h1> <p>I made a basic proof of concept mastodon client in picotron! All it does is fetch a single status, given an instance and status id.</p> <p>I am using the text editor GUI widget to display the text and take your input. To select the instance and status id, simply type them on the given lines. To submit, type a <code>y</code> at the end of the last line.</p> <p>(For example: if you wanted to fetch <a href="https://mastodon.social/@zep/112095878554051090">https://mastodon.social/@zep/112095878554051090</a>, the instance would be <code>mastodon.social</code> and the status id would be <code>112095878554051090</code>)</p> <p>Once a post is displayed, you can go back to the menu by typing <code>y</code> at the end of the first line.</p> <p>I made a different version of this <a href="https://gist.github.com/Rayquaza01/6f4fe81cc127227e27d22b63f000ae8c">earlier</a>, but that version used a python server to handle the json and text formatting. This version does everything entirely within picotron.</p> <h2>Credits</h2> <p>JSON - <a href="https://gist.github.com/tylerneylon/59f4bcf316be525b30ab">https://gist.github.com/tylerneylon/59f4bcf316be525b30ab</a><br /> Word Wrap - <a href="https://rosettacode.org/wiki/Word_wrap#Lua">https://rosettacode.org/wiki/Word_wrap#Lua</a></p> https://www.lexaloffle.com/bbs/?tid=140880 https://www.lexaloffle.com/bbs/?tid=140880 Mon, 18 Mar 2024 17:49:07 UTC Picotron Utilities (cat, touch, tree, wget, grep, frange) <p> <table><tr><td> <a href="/bbs/?pid=143436#p"> <img src="/bbs/thumbs/pico64_picotron_utilities-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=143436#p"> picotron_utilities</a><br><br> by <a href="/bbs/?uid=92431"> arnaught</a> <br><br><br> <a href="/bbs/?pid=143436#p"> [Click to Play]</a> </td></tr></table> </p> <p>I made a handful of commandline utilities for picotron that you might find useful.</p> <p><a href="https://github.com/Rayquaza01/picotron-utilities">https://github.com/Rayquaza01/picotron-utilities</a></p> <p>So far, Picotron Utilities has:</p> <p>cat - print files<br /> touch - create new files<br /> tree - print tree view of a directory<br /> wget - download a file using fetch()<br /> grep - search in a file or recursively search through all files in a folder<br /> frange - print a file or range w/ line numbers<br /> pwd - print the current working directory</p> <h1>Installing as a Yotta Package</h1> <p>You can install the utilities included in this cart with <code>yotta util install #picotron_utilities</code></p> <h1>Installing as a Bundle Command</h1> <p>You can install this cartridge as a bundle command by saving it to your utility path.</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>load #picotron_utilities save /appdata/system/util/busybox</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Once installed, you can run a bundled command by passing that command as an argument, like <code>busybox tree</code>.</p> <h1>Installing Manually</h1> <p>You can copy the <a href="https://github.com/Rayquaza01/picotron-utilities/tree/main/src/exports/appdata/system/util">lua files from the repo</a> to <code>/appdata/system/util</code> manually. These files are also inside the cartridge's <code>exports</code> folder.</p> <h1>Changelog</h1> <p>[2024-03-18]</p> <ul> <li>Added pwd command (<a href="https://github.com/Rayquaza01/picotron-utilities/pull/2">#2</a>, thanks jesstelford!)</li> <li>frange supports negative start values (e.g. <code>frange file.txt -10</code> will print last 10 lines) (<a href="https://github.com/Rayquaza01/picotron-utilities/pull/3">#3</a>, thanks pancelor!) <ul> <li>This pr also changes the method frange uses to build it's output string. I've also added those changes to grep and tree</li> </ul></li> <li>grep now supports lua patterns. See <a href="https://www.lua.org/pil/20.2.html">Programming in Lua 20.2 - Patterns</a> <ul> <li>If you want to search for a character with a special meaning like <code>.</code>, you'll need to escape it with <code>%.</code></li> </ul></li> </ul> <p>[2024-03-22] - v1.0.0</p> <ul> <li>Added a comment that points back to the repo to the top of every script.</li> <li>Made an installable cartridge version. <ul> <li>If you have any trouble using either of the new installation methods, please let me know!</li> </ul></li> </ul> https://www.lexaloffle.com/bbs/?tid=140771 https://www.lexaloffle.com/bbs/?tid=140771 Sun, 17 Mar 2024 04:12:37 UTC Wordle <p> <table><tr><td> <a href="/bbs/?pid=143322#p"> <img src="/bbs/thumbs/pico64_wordle-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=143322#p"> Wordle 1.1</a><br><br> by <a href="/bbs/?uid=92431"> arnaught</a> <br><br><br> <a href="/bbs/?pid=143322#p"> [Click to Play]</a> </td></tr></table> </p> <h1>Wordle for Picotron</h1> <p>This is a basic wordle clone. A green letter is in the correct position, a yellow letter is in the wrong position, and a gray letter is wrong.</p> <p>This uses an invisible text editor to let you type the letters. Press enter to submit your guess.</p> <p>If you enter a guess that is less than 5 letters, it will clear your text input. There is also no check to see if your guess is a real word, so you can enter random letters if you want. The word list I used is the official wordle list, which I got from <a href="https://gist.github.com/scholtes/94f3c0303ba6a7768b47583aff36654d">here</a>.</p> <p>Hope you enjoy it!</p> <h2>Changelog</h2> <p>[2024-03-17]</p> <ul> <li>Gray boxes on the line you're typing always display</li> <li>Fixed off by 1 when choosing a random word</li> </ul> https://www.lexaloffle.com/bbs/?tid=140727 https://www.lexaloffle.com/bbs/?tid=140727 Sat, 16 Mar 2024 15:50:34 UTC