WidgetOtaku [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=94013 goto function does work! <p>Just found out that the &ldquo;goto&rdquo; function is actually implemented in Picotron; I&rsquo;ve tested a pico8 code snippet by <a href="https://www.lexaloffle.com/bbs/?uid=13845"> @ultrabrite</a> and put it into the usual function _draw()</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 _draw() cls() x=1 y=0 n=120 ::io:: d=rnd(2)&gt;1 and 0 or 5 line(x+5-d,y,x+d,y+5,11) x+=6 if(x&gt;n+6) x=1 y+=6 print(' ') if(y&gt;n) y=n flip() goto io 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=141768 https://www.lexaloffle.com/bbs/?tid=141768 Thu, 18 Apr 2024 11:58:21 UTC &quot;permanent&quot; print() when keys are pressed? <p>I'm trying to make a simple text-adventure game within the terminal (using the arrow keys as input), but the print() functions for the various options aren't kept permanently on screen.<br /> What am I doing wrong here?</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>cls(0) -- left = &quot;80&quot; -- up = &quot;82&quot; -- right = &quot;79&quot; -- down = &quot;81&quot; print(&quot;Press a key:&quot;) for kp = 79,81 do if key(80) and key(kp) then print(&quot;left&quot;) elseif key(81) and key(kp) then print(&quot;center&quot;) elseif key(79) and key(kp) then print(&quot;right&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=141695 https://www.lexaloffle.com/bbs/?tid=141695 Sat, 13 Apr 2024 12:54:53 UTC keyboard entry? <p>Is there a way for a keyboard entry when I need an integer from the user?<br /> Especially for this:<br /> <a href="https://www.lexaloffle.com/bbs/?tid=141477">https://www.lexaloffle.com/bbs/?tid=141477</a></p> <p>On the line of </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>local playerHand = drawCards(5,cardDeck)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>to which 5 can be modified&hellip;</p> <p>btw can the F keys be overridden to a specific integer? (ie. pressing F12 for an integer of 12)</p> https://www.lexaloffle.com/bbs/?tid=141525 https://www.lexaloffle.com/bbs/?tid=141525 Sun, 07 Apr 2024 12:14:04 UTC shuffling and dealing cards <p>based on the tutorial from here <a href="https://docs.coronalabs.com/tutorial/data/shuffleTable/index.html">https://docs.coronalabs.com/tutorial/data/shuffleTable/index.html</a></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>local cardDeck = {&quot;AS&quot;,&quot;AH&quot;,&quot;2S&quot;,&quot;3S&quot;,&quot;KH&quot;,&quot;QD&quot;,&quot;QS&quot;,&quot;KD&quot;,&quot;4D&quot;,&quot;10H&quot;} math.random(flr(rnd())) local function shuffleTable(t) if (type(t) ~= &quot;table&quot;) then print(&quot;warning&quot;) return false end local j for i = #t, 2, -1 do j = math.random(i) t[i], t[j] = t[j], t[i] end return t end cardDeck = shuffleTable(cardDeck) local currentIndex = 1 local function drawCards(num,deck) local cardsDrawn = {} for i = currentIndex, num do cardsDrawn[#cardsDrawn+1] = deck[i] end currentIndex = currentIndex + num return cardsDrawn end local playerHand = drawCards(5,cardDeck) print(table.concat(playerHand,&quot;\n&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=141477 https://www.lexaloffle.com/bbs/?tid=141477 Fri, 05 Apr 2024 22:20:52 UTC choosing multiples from an array without dupes <p>tbh I'm trying to program a digital oracle deck of cards for personal use, and I can't seem to find a way to code for &quot;picking card(s)&quot; without doubles. Maybe with some keyboard entry for indicating the program to choose x items from the randomized array. </p> https://www.lexaloffle.com/bbs/?tid=141472 https://www.lexaloffle.com/bbs/?tid=141472 Fri, 05 Apr 2024 18:42:45 UTC Modding ddate? <p>I&rsquo;m definitely not a professional programmer, albeit having a bachelors degree in information management.<br /> So&hellip; is there anything that I can improve onto my ddate cart?<br /> I think that I can add a &ldquo;hand of Eris&rdquo; in ascii with no problem.</p> https://www.lexaloffle.com/bbs/?tid=141461 https://www.lexaloffle.com/bbs/?tid=141461 Fri, 05 Apr 2024 11:46:23 UTC Coding a static wallpaper from png? <p>Can anyone tell me what&rsquo;s the code for making a single image (from converted png) into a static wallpaper?</p> https://www.lexaloffle.com/bbs/?tid=141359 https://www.lexaloffle.com/bbs/?tid=141359 Thu, 04 Apr 2024 18:28:20 UTC Can&rsquo;t run Picotron on Lenovo Duet Chromebook <p>idk if the arm64 of Picotron will eventually come out, but I definitely can&rsquo;t run the normal version on this specific Chromebook :/</p> https://www.lexaloffle.com/bbs/?tid=141363 https://www.lexaloffle.com/bbs/?tid=141363 Wed, 03 Apr 2024 21:30:45 UTC ddate for Picotron <p>I'm so glad that I've finally made my first cart :3<br /> Initially coded on Picotron 0.1.0e<br /> <em>Please note that the date is now synced to local time as of version 1.4!</em><br /> <strong>Added &quot;Hand of Eris&quot; as of version 1.3</strong><br /> <table><tr><td> <a href="/bbs/?pid=145494#p"> <img src="/bbs/thumbs/pico64_ddate-4.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=145494#p"> ddate 1.4</a><br><br> by <a href="/bbs/?uid=94013"> WidgetOtaku</a> <br><br><br> <a href="/bbs/?pid=145494#p"> [Click to Play]</a> </td></tr></table> </p> https://www.lexaloffle.com/bbs/?tid=141389 https://www.lexaloffle.com/bbs/?tid=141389 Tue, 02 Apr 2024 17:08:20 UTC time stats aren&rsquo;t showing up <p>I&rsquo;ve tried to use the &ldquo;stat(x)&rdquo; function to call in the local system&rsquo;s time, but it seems that this isn&rsquo;t yet implemented.</p> https://www.lexaloffle.com/bbs/?tid=141360 https://www.lexaloffle.com/bbs/?tid=141360 Mon, 01 Apr 2024 21:18:18 UTC