I've recently been on a bit of a retro-computing kick, and with Microsoft making their 6502 BASIC open-source, I was inspired to do something BASIC related in PICO-8. I originally thought about making a BASIC interpreter, but that was soon put on the back-burner when I noticed that PICO-8's dialect of Lua already has many similarities. Instead, it seemed a fun idea to convert BASIC listings to PICO-8 while trying to keep a similar feel to the code structure.

I pulled up one of the first results I could find and got to work. First, I converted the whole thing directly to Lua as closely as possible. Reverse-engineering the ZX Spectrum machine code was probably the trickiest part but a lot of fun. Next, I had to convert it into something better suited for the PCIO-8. This also gave me the opportunity to layout the code in an order that made a bit more sense to me. Finally, after some play testing and fiddling about, I copied the listing over to a mock-up of a magazine spread, and that's what is presented here!

Unable to display PDF file. Download instead.

Typing in the poke statements is a bit awkward, but I suppose that emulates the experience of typing in data statements. Speaking of which, while I didn't find a good opportunity to do so here, I think it would be interesting to use pokes/peeks to replicate data/read/restores. It would be a bit more authentic to that BASIC structure I was going for. Using pget to test screen contents instead of a table that mimics Spectrum screen attributes would also probably have less code overhead and look nicer in the listing. A limitation of this approach though is requiring that all custom characters (that need to be tested) have a reliable pixel to test.

Credit to David Millington for the original listing in Popular Computing Weekly, and to Simbax and RhythmLynx for the PCIO-8 font used in the spread.


Mary Raleigh (Dr. Roly Poly), a whimsical professor of robotics engineering, has developed a game to teach her students concepts in automation. The aim of the game is to guide a marble through a maze using only a small set of context-based rules. You can try to solve the various challenges she's devised or make your own!

Controls

Term........................controller / keyboard / mouse

Navigation...............d-pad / arrow keys / mouse

Primary button........O button / Z or C key / left mouse button

Secondary button....X button / X or V key / right mouse button

Menu button............options button / enter key / middle mouse button

Quick Guide

The main game is a series of challenges available from the main menu. Open challenges will appear with a name and illuminated preview. Simply press the primary button to play it. Completing unfinished levels will unlock new ones.

While inside a challenge, the game board is divided into a grid. After each turn, the grid will shift.

The grid cell that contains the marble is the marble’s context. This context is used for the table on the right. During a turn, the marble context on the left will result in the configuration on the right.

Please note that each entry in the table has rotational symmetry. That means, that each entry covers four possible scenarios.

Each entry has an icon to the left that determines something about the entry:

  • solid circle: result is already set but can be changed by the player
  • hollow circle: result needs to be set by the player before it can be used
  • lock: result is set by the game and cannot be changed
  • "X": context is a failure condition

Solving a challenge requires figuring out how these entries need to be set to get the marble to the goal.

Source: Original Lexaloffle Post