Log In  
Follow
arnaught
[ :: Read More :: ]

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.

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 U+00C2 U+0080 instead of just U+0080.

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: Â
P#144493 2024-03-26 04:32

[ :: Read More :: ]

Cart #magic8ball-0 | 2024-03-24 | Embed ▽ | License: CC4-BY-NC-SA
7

This Picotron cartridge can predict the future! Simply ask it any yes or no question, shake the window, and you'll get your answer!

(I hear you can also press z to get an answer, but that seems less fun than shaking the window.)


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).

I wanted to put a sound effect when shaking the window, but I have no idea how to work the instrument editor lol.

P#144300 2024-03-24 15:03

[ :: Read More :: ]

Some linux distros include code in the default .bashrc that chain loads files from ~/.bashrc.d. This is useful for keeping your config organized. (I like keeping my aliases in a separate file, for instance.)

I've made a snippet that does this for Picotron. Add this to your /appdata/system/startup.lua, and it will chain load any .lua files in the folder /appdata/system/startup.

startup_folder = "/appdata/system/startup"
if fstat(startup_folder) == "folder" then
    for file in all(ls(startup_folder)) do
        filename = startup_folder .. "/" .. file
        if fstat(filename) == "file" and file:find("%.lua$") then
            create_process(filename)
        end
    end
end
P#144150 2024-03-22 18:14

[ :: Read More :: ]

Cart #pipes-0 | 2024-03-19 | Embed ▽ | License: CC4-BY-NC-SA
7

I made a pipes screensaver, inspired by the classic 3D Pipes Screensaver.

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.

I am not saving information about the pipes manually. I just draw the current pipe, and never cls. 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 cls. So instead of storing and drawing up to 3060 sprites every frame, instead I only store and draw one.

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 think 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.)

(Edit: The sprite flipping issue was fixed in 0.1.0c!)

The pipe only expands once every 8 frames. I think at full speed it goes too fast to watch it.

P#143829 2024-03-19 14:17 ( Edited 2024-03-24 21:39)

[ :: Read More :: ]

Cart #r01mastodon-0 | 2024-03-18 | Embed ▽ | License: CC4-BY-NC-SA
18

Mastodon

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.

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 y at the end of the last line.

(For example: if you wanted to fetch https://mastodon.social/@zep/112095878554051090, the instance would be mastodon.social and the status id would be 112095878554051090)

Once a post is displayed, you can go back to the menu by typing y at the end of the first line.

I made a different version of this earlier, but that version used a python server to handle the json and text formatting. This version does everything entirely within picotron.

Credits

JSON - https://gist.github.com/tylerneylon/59f4bcf316be525b30ab
Word Wrap - https://rosettacode.org/wiki/Word_wrap#Lua

P#143734 2024-03-18 17:49

[ :: Read More :: ]

Cart #picotron_utilities-0 | 2024-03-22 | Embed ▽ | License: CC4-BY-NC-SA
21

I made a handful of commandline utilities for picotron that you might find useful.

https://github.com/Rayquaza01/picotron-utilities

So far, Picotron Utilities has:

cat - print files
touch - create new files
tree - print tree view of a directory
wget - download a file using fetch()
grep - search in a file or recursively search through all files in a folder
frange - print a file or range w/ line numbers
pwd - print the current working directory

Installing as a Yotta Package

You can install the utilities included in this cart with yotta util install #picotron_utilities

Installing as a Bundle Command

You can install this cartridge as a bundle command by saving it to your utility path.

load #picotron_utilities
save /appdata/system/util/busybox

Once installed, you can run a bundled command by passing that command as an argument, like busybox tree.

Installing Manually

You can copy the lua files from the repo to /appdata/system/util manually. These files are also inside the cartridge's exports folder.

Changelog

[2024-03-18]

  • Added pwd command (#2, thanks jesstelford!)
  • frange supports negative start values (e.g. frange file.txt -10 will print last 10 lines) (#3, thanks pancelor!)
    • This pr also changes the method frange uses to build it's output string. I've also added those changes to grep and tree
  • grep now supports lua patterns. See Programming in Lua 20.2 - Patterns
    • If you want to search for a character with a special meaning like ., you'll need to escape it with %.

[2024-03-22] - v1.0.0

  • Added a comment that points back to the repo to the top of every script.
  • Made an installable cartridge version.
    • If you have any trouble using either of the new installation methods, please let me know!
P#143436 2024-03-17 04:12 ( Edited 2024-03-22 12:42)

[ :: Read More :: ]

Cart #wordle-1 | 2024-03-17 | Embed ▽ | License: CC4-BY-NC-SA
6

Wordle for Picotron

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.

This uses an invisible text editor to let you type the letters. Press enter to submit your guess.

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 here.

Hope you enjoy it!

Changelog

[2024-03-17]

  • Gray boxes on the line you're typing always display
  • Fixed off by 1 when choosing a random word
P#143322 2024-03-16 15:50 ( Edited 2024-03-17 14:54)