Log In  
Log In  


Hobby developer from Norway. I enjoy grid-based puzzle games.

This isn't exactly a bug, but an aspect of the API that bothers me a bit.

In PICO-8:

add(table, element) -- returns the added element
del(table, element) -- returns nil

This doesn't make much sense to me. Returning the added element is a nice convenience, since it allows you to do things like creating multidimensional tables succintly:

for x=1, width do
 local col = add(table, {})
 for y=1, height do
  add(col, {})

But returning nil when deleting an element does not make sense to me. If it returned the deleted element, it would be possible to know whether an element was found or not, without first checking for membership.

For comparison, this is how it is in Lua:

table.insert(table, element) -- returns nil
table.remove(table, position) -- returns the removed element
P#62932 2019-03-21 12:37

This is a fun bug, but not exactly a big deal. I'm not sure if it has been reported before.

If you delete any amount of text at the end of a cartridge, you can retrieve it by pressing the DELETE key while your cursor is at the end of the file (as long as the buffer is not empty).

Simplest way to reproduce: Write something in the PICO-8 code editor, and then delete everything. Write something (one character will do) and then press DELETE. Voila!

P#62444 2019-03-02 23:54

Hey, I'm trying to figure out why btnp(x) seems to be true for one frame after stat(31)=="x" is true in devkit mode, or if I'm doing something dumb.

Here's an example cart. Press X, and it will show display the number of the frame that it registered the devkit keypress and the X button press respectively. There seems to be one frame difference.

Cart [#zoyifizotu-0#] | Code | 2019-02-21 | No License | Embed

My actual usecase is this: I have a password input in a game where I want to record numerical input from the devkit keyboard, but I also want it to record the X button, which confirms the password. Unfortunately, the 8 key is mapped to the X button; when they're also recorded on different frames it becomes a little convoluted to separate the two.

P#62134 2019-02-21 18:58

Just a small snippet from a token-saving discussion on the Discord last night.

If you need to iterate over neighboring tiles (for example when writing a path finding algorithm for 7DRL), this natural approach is pretty token heavy:

-- four directions, 29 tokens
for direction in all{{-1,0},{0,-1},{1,0},{0,1}} do
 local x,y=direction[1],direction[2]

-- eight directions, 45 tokens
for direction in all{{-1,0},{0,-1},{1,0},{0,1},{1,1},{-1,-1},{1,-1},{-1,1}} do
 local x,y=direction[1],direction[2]

-- eight directions, 43 tokens
for i=1,16,2 do
 local x,y=directions[i],directions[i+1]

-- eight directions, 30 tokens
for x in all(directions) do
 for y in all(directions) do
  if x!=0 or y!=0 then

Why not use trigonometry?

-- four directions, 16 tokens
for i=0,1,0.25 do
 local x,y=cos(i),sin(i)

-- eight directions, 24 tokens
for i=0.125,1,0.125 do
 local x,y=flr(cos(i)+.5),flr(sin(i)+.5)
P#62065 2019-02-19 10:00 ( Edited 2019-02-19 10:14)

Cart [#lighthouse-0#] | Code | 2019-02-01 | License: CC4-BY-NC-SA | Embed

A tweetcart I made to teach myself what sin() and cos() actually do. I never took trigonometry.

P#61430 2019-02-01 09:54 ( Edited 2019-02-01 09:56)

Cart [#picochallenge-0#] | Code | 2019-02-01 | License: CC4-BY-NC-SA | Embed

A demake of my game Patrick's Cyberpunk Challenge for the TweetTweetJam.

The object of the game is to move Patrick the Leprechaun around the board and remove all 28 squares. Squares with special symbols will remove extra squares:

Move Patrick to a square using the arrow keys. Note that you can (and sometimes must) move diagonally by pressing two arrow keys simultaneously.

Puzzles might be impossible to solve, and the game doesn't recognize if you win or lose. If the screen is empty except for Patrick, you win! If you have no legal moves, you lose and must restart the game manually.

Source code:

poke(24364,3)x="웃"v="▥"h="▤"b={}for i=1,36 do b[i]=i%9<2 and""or"█"end for i in all{"⬆️","➡️",h,"⬅️","⬇️",v,x}do repeat f=1+flr(rnd(36))until b[f]!=""b[f]=i
end::_::t=btnp cls()for i=0,35 do
?k,i%9*8,6*flr(i/9)+20,k==x and 11 or 7
end b[p]=""q=p
if(b[q]and#b[q]>0)p=q t=b[p]
if(t=="⬆️"or t==v)b[p-10]=""b[p-9]=""b[p-8]=""
if(t=="⬇️"or t==v)b[p+10]=""b[p+9]=""b[p+8]=""
if(t=="⬅️"or t==h)b[p-10]=""b[p-1]=""b[p+8]=""
if(t=="➡️"or t==h)b[p+10]=""b[p+1]=""b[p-8]=""
b[p]=x flip()goto _

"Unminified" source code:

--patrick's picochallenge
--by tobiasvl

--use 64x64 resolution

--generate a blank board of
--empty █ tiles
--the board is 7x4, but we
--represent it as a one-
--dimensional table. we also
--represent it as 36 tiles, ie
--a 9x4 grid, with two columns
--of "" on each end, so ⬅️➡️▤▥
--tiles don't wrap around when
--they destroy adjacent tiles.
for i=1,36 do
  if i%9<2 then
    --first and last column

--populate the board with tiles
--and the player's starting tile
for i in all(tiles) do
  --find a random tile which is
  --not in the "invisible" outer
  until board[position]!=""
  --remember the player
  if (i=="웃") player=position

--game loop

--print the board
--here's the only obfuscation i
--left in: here i loop from
--0 to 35, instead of 1 to 36,
--because then i only need to
--do i+1 once instead of i-1
for i=0,35 do
  local tile=board[i+1]
  --the player is green
  if tile=="웃" then
  --properly centering the board
  --takes up too many characters
  --so just an approximation

--erase the player character
--and destroy the tile
--remember the player's position

--move the player's position if
--an arrow key is pressed
if (btnp(⬅️)) new_player-=1
if (btnp(➡️)) new_player+=1
if (btnp(⬆️)) new_player-=9
if (btnp(⬇️)) new_player+=9

--if we're still inside the
--board proper, ie the tile isn't
--nil (outside the board) or ""
--(the border columns), make
--that the new position.
if board[new_player] and board[new_player]!="" then

--if the player lands on one of
--the special tiles, destroy
--adjacent tiles
if tile=="⬆️" or tile=="▥" then
  --destroy three tiles above
if tile=="⬇️" or tile=="▥" then
  --destroy three tiles below
if tile=="⬅️" or tile=="▤" then
  --destroy three tiles left
if tile=="➡️" or tile=="▤" then
  --destroy three tiles right

--put the player in the new
--(or old!) position

goto _
P#61429 2019-02-01 08:53 ( Edited 2019-02-01 08:57)

Not a big problem, but probably easy to fix.

If you're in the sprite editor and press Alt+Left to go to the code editor, the cursor will move one space to the left.

The same happens if you're in the music editor and press Alt+Right; the cursor will move to the right.

P#61418 2019-01-31 23:26

Here's a strange bug I found. If you write something like this in the code editor:


and you search for 0 with CTRL+F, it will highlight the first 0. If you then press CTRL+G, however, it will fail to find the second one. The same goes for the 5.

From my testing, this seems to only happen with every other occurence. If you search for 0 here:


then CTRL+G will only highlight the first and the third argument.

I've only had it happen with function arguments, and only with single-character arguments; single-letter variable names also have this problem. Putting a space after the commas also makes it behave properly.

It's a bit of a problem when writing tweetcarts where you have little whitespace, short variable names, and want to find variables or number literals to replace while optimizing :)

P#61417 2019-01-31 23:23

Cart [#sunrise-0#] | Code | 2019-01-31 | License: CC4-BY-NC-SA | Embed

Tweetcart, 272 chars.

Grid based on tweetcart by @electricgryphon.

P#61403 2019-01-31 18:30 ( Edited 2019-01-31 18:38)

In the code editor, if you place the cursor at the very first character in the file, the delete key does nothing.

Expected behavior: It should delete the character under the cursor.

P#61360 2019-01-30 19:19

There seem to be some bugs with the parsing of an escaped backslash:

So, two issues:

  1. The syntax highlighter doesn't stop parsing the line as a string if it encounters two backslashes in a row, although it will run without problems
  2. ...except when used as an argument to the ? shorthand function, which will give an error

It's not in the screenshot, but if there are any trailing characters after the double backslash, the syntax highlighter will be happy again.

P#61359 2019-01-30 19:17

I watched @zep talk about PICO-8 and cozy design spaces again today, and it really resonates with me. I work as a developer, and I really hate all the cruft we have to deal with. Like the web! God, I hate the web and what it has turned into.

I really like stuff like Zen of Python, programming aphorisms, principles like DRY, POLA, KISS, etc. I watched through the video and tried to write down some nuggets of wisdom. Apologies to @zep if he feels misrepresented in any of these quotes.


  • Small things matter
  • Discard and move on (the "license to abandon")
  • Inhabit boundaries
  • Follow a new path
  • Ignore the real world
  • Work in a cosy place

The Zen of PICO-8

  • When you type cls() you're not just clearing the screen, you're clearing your mind and your soul, preparing for something new.
  • You're among friends.
  • Value design over content.
  • Be playful.
  • Focus on what's important to you and throw away what's not important.
  • Confront cute problems.
  • Don't be afraid to do anything wrong.
  • Make something for the love of making.
  • Just make something, capture the concept, and then move on to something else.

The Zen of Zep?

And then some words of wisdom that aren't necessarily tied to PICO-8, or directed at us as PICO-8 users.

  • Software sucks. It's terrible.
  • The tools shape the work.
  • Remove the semantics.
  • No magic.
  • Avoid minification.
  • People don't know what they want.
  • Fantasy consoles are impressionist hardware.
  • The tool has the manifesto inside itself.
  • A tool sometimes invites you to make something for it.
  • Machines can be cute.
  • The thing that makes a console a console is not the hardware, it's everything else.
P#60934 2019-01-17 20:56

Cart [#59036#] | Code | 2018-11-15 | License: CC4-BY-NC-SA | Embed

The classic Lights Out puzzle game for the TweetTweetJam. The source code fits in two tweets (560 characters).

Your goal is to turn all the lights off. However, each light toggles all four adjacent lights as well.

I didn't have room for different levels, but there's two modes:

  • Lights Out Classic: Lights toggle between off and on (red). Best solution is 15 moves.
  • Lights Out 2000: Lights toggle between off, red and green. Best solution is 18 moves.
P#59034 2018-11-15 18:15 ( Edited 2019-02-01 08:58)

Cart [#meteor_night_2_0-0#] | Code | 2019-02-09 | License: CC4-BY-NC-SA | Embed

This is a small game based on the Famicase "Meteor Night" for the "Chill"-themed A Game By Its Cover jam 2018. (itch.io page here)


There's a meteor shower coming, and you take your friend or date stargazing after dark. They've never gone stargazing before, so you'll have to point out any meteors you see to your friend or date.

It's chilly outside, so make sure you keep your friend or date warm. If they see a beautiful meteor, they will forget the cold for a little while; if they keep missing meteors you point out, they'll grow frustrated and cold.

Eventually, though, they'll probably want to go home. Maybe to your place?


Using a mouse is recommended for precision and speed. Don't miss the meteors!

  • Mouse / arrow keys: Look around the sky
  • Left click / X: Point out meteor

Chill/Chill Out

Press O on the title screen to toggle between Chill mode and Chill Out mode.

In the default Chill mode, your friend or date will get colder with time. Point out as many meteors as you can to get a new high score.

In Chill Out mode, it's a warm, summer night; you won't get cold, and can just chill out as long as you want to. High score is not tracked in this mode.


P#56746 2018-09-16 16:52 ( Edited 2019-02-09 16:32)

Found this nice little snippet on Twitter: Put a flip in it

There are some cool ones under the hashtag #putaflipinit

P#56221 2018-09-05 07:26 ( Edited 2018-09-05 11:26)

Cart [#55662#] | Code | 2018-08-25 | License: CC4-BY-NC-SA | Embed

A remake of the classic computer puzzle game LaserTank for PICO-8, for the Demake jam.

Includes a hand-picked collection of 50 levels from the original game. I think I'll have to make a multicart version to include more levels.

I haven't implemented all the physcis quirks (bugs) of the original game, but I don't think any of the included levels rely on them to be solved. At least I hope not.

itch page

P#55663 2018-08-25 14:10 ( Edited 2018-11-03 23:43)

P#54921 2018-08-10 02:32 ( Edited 2018-09-04 21:13)

Cart [#56257#] | Code | 2018-09-06 | License: CC4-BY-NC-SA | Embed

Remove all 28 squares from the board in a neverending series of calm, randomized puzzles set in a dystopian, cyberpunk world.

Patrick’s Cyberpunk Challenge is fun for all ages. Are you ready for the challenge?

The object of the game is to move Patrick around the game board and remove all 28 squares. Squares with coloured balls will remove extra squares and can make the game trickier. The games are randomly generated, but you can also create your own games or input game codes made by others.

This is a fanmade sequel to the 1998 freeware sensation Patrick's Challenge II by Reldni Productions, for the Cyberpunk-themed "So bad it's good" Jam 2018.

The puzzle codes are compatible with Patrick's Challenge II. You can also go to Reldni's website to find more codes and play hand-crafted Reldni puzzles.

You currently have to use the devkit mouse to place the objects in the correct squares manually, but I hope to have proper gamepad support soon so you can type in the codes. I also plan to add support for saving puzzles, so you can make your own (limited) run of puzzles to get a high score in.

P#54572 2018-08-01 09:40 ( Edited 2018-09-06 08:42)

Is there a way to display a PICO-8 number as a 32-bit unsigned integer?

I considered implementing a password system in a demake I'm making, but it requires me to interpret 4 bytes as an unsigned 32-bit int. I can't find a way to do that though.

Has anyone made a library to do this? If there's no native support, I assume you need to do some arithmetic that operates on an intermediate string representation of the number.

Note: I don't need to do 32-bit arithmetic. I just want to get the decimal representation (as a string is fine) of a number, as if it were an unsigned 32-bit int.

P#52659 2018-05-12 17:04 ( Edited 2018-07-18 11:32)

Cart [#54284#] | Code | 2018-07-19 | License: CC4-BY-NC-SA | Embed

Hey! This is my first Pico-8 game, a clone of the DS game Polarium.

It contains 100 levels. You can get a hint for every level if you're stuck.

There's also a level editor, which lets you create your own custom levels. You can even share levels with other people with 30-digit passwords. These passwords are completely compatible with Polarium, so you can also find lots of levels other people have made online for an extra challenge. 20 custom levels can be stored.

P#51985 2018-04-25 04:11 ( Edited 2018-07-19 13:00)

View Older Posts
About | Contact | Updates | Terms of Use
Follow Lexaloffle:        
Generated 2019-03-24 22:13 | 0.095s | 4194k | Q:147