I have a table:
a={0,0,1,2,0,6,9,2,0,5,3,0,7,0,0}
I want to sort it so the 0's are moved to the front
This works:
a={0,0,1,2,0,3,4,0,0,5,6,7,8,0,9,10}
b={}
c={}
for v in all(a) do
if v==0 then
add(b,v)
else
add(c,v)
end
end
for v in all(c) do
add(b,v)
end
a=b |
but is clunky and since this will be in a recursive function, efficiency is essential.
what is a more elegant/quicker way to do this?
Title: protoSTG
Version: 1.3xx Final
Platform: PICO-8 (128×128) • Keyboard/Controller
Genre: Vertical shmup • 1-hit kills • Score attack
protoSTG aspires to be a clean, readable vertical shooter: tap a 5-way spread to “paint” lanes, hold a precise focus beam for damage and micro-dodging, feed a 3-tier homing-missile gauge, graze precisely for points, and tear a modular boss apart—parts first or greedily straight to the core. There’s also a special “Golden” celebration if you dismantle the boss and meet tight chain/score rules.
Controls (default)
B1 (Shot): tap = 5-way spread; hold = continuous focus beam + slow move (~45%).
B2 (Missile): fires homing missiles based on a 3-segment gauge; holding B2 automatically taps L1 when available.
B1 + B2 together (fresh press on both): Bomb/Freeze—Ship 1 = Bomb (bullet clear + heavy damage), Ship 2 = Freeze (~1.5 s stasis, then brief faster “catch-up”).

okay so basically this trick almost gives you infinite savedata
first, choose a memory address above 0x7fff to represent a progress counter, a memory address above 0x7fff to represent if the game has already set the progress counter to 0, a memory address above 0x7fff to represent the progress before updating, a memory address to declare if the game has started, a variable declaring if the game is calibrating the save values, and a variable inside the game declaring how many extra groups of 64 savedata values are required.
second, in the _init function, set the initial progress counter to the actual progress counter. make an if statement which checks if the progress counter is equal or over the limit. inside that statement, run cartdata with an id concatenated with the progress, set a group of memory addresses to the cartdata values, change the progress counter by one by using the initial progress counter, and then finally load the cartridge again.
third, in the _update function, add an if statement which checks if the game has started. move all of the previous code inside of the _update function into that statement.
this method exists which almost no information is spread about on the internet
all you have to do is print "\A" concatenated with the note, and then the octave e.g:print("\AD#3"). this plays the D# note on the third octave you can also print a message as it plays if you concatenate the string with a space, and then the message e.g:print("\AD#2 Hello World!"). one thing i find really cool about this feature is that you can harmonize notes by concatenating multiple notes by a space e.g:print("\AD#3 \AD2 \AD1 \AC#1 \AD0").
Robot Vacuum Simulator!
Hi all, first Pico 8 game here.
Controls
Use the arrow keys to move the robot around!
Rules
Clean up as much of the dirt as you can.
Don't forget to clean under the tables!
And avoid the cats - they love to ride on your back, but they slow you down a lot.
Pro tip - cats can't jump on you when you're under a table.
Behind The Scenes
So the idea for this game was "what's a simple game I can make, so that I don't get scope creep paralysis, and I can actually finish something?".
From there I thought of a vacuum sim where you have to avoid household animals, and it turned into this.
For me this game is more of a way to figure out what else goes into a game: menu, sfx, music, level design.
It's easy to think of a "cool game idea", but an idea does not a whole game make.
For that reason, I wasn't really aiming to make incredibly fun experience. I wanted to finish something...
Hopefully it's a little bit fun though!
Credits
You were expecting a collaboration but instead it was ME, TOBIO!
Changelog
1.0.3
- Fix the issue where completing level 8 breaks the game
- Add an easter egg for if you get a star on each level
1.0.2
- Fix complete level screen only working once D:
1.0.1
- Make 'press x to continue' use the x button and not the z button

SET! For PICO-8
SET! is a card game where you try to find a SET in the 12 given cards as fast as you can.
(if there aren't any SETs on the table, new cards will be added until there is at least one)
I made this game in around 2 weeks for my computer science exam in highschool a few years ago, so it's not that polished, but I figured it's better to publish it than to leave it for no one to ever see. This game is by far my favourite card game, although no one wants to play it against me anymore since I'm way too fast :P
NOTE: There is no support for playing with keyboard controls, you are going to have to use a mouse or a touchscreen, but I will add this in the future if there is demand for it.
How to play
In order to play this game you'll first have to know what a SET is.
You'll notice that every card has 4 different properties with 3 possible values:
- Amount: One, Two, Three
- Color: Red, Green, Blue
- Shape: Bean, Diamond, Squiggle
- Filling: Full, Striped, Empty
A SET consists of 3 cards, where every individual property has to be either all the same, or all different.
These 3 cards form a SET:
- One, Red, Bean, Full
- Two, Red, Bean, Striped
- Three, Red, Bean, Empty
This is valid because the amounts are all different, the colors are all the same, the shapes are all the same and the fillings are all different
These 3 cards do not form a SET:
- Two, Green, Squiggle, Full
- Two, Red, Bean, Full
- Two, Red, Diamond, Full
This is invalid because while the other properties follow the rules the colors are not all the same and not all different
From here it should be pretty easy to understand when 3 cards are a SET and when they aren't.
Speedrunning
My personal best is a 3:21. I will keep track of the top 5 best times in this leaderboard. I don't check the BBS every single day, so if you want your time on the leaderboard fast then send me a DM on Discord at @vexxter9.
Current top 5:
- Vexxter - 3:21
- Coko & Ana - 16:22

So I'm currently working on a little practise game about a duck in a pond. In the game you have to avoid slices of bread which damage your health if you eat them.
Until recently I just manually added 3 slices of bread as individual objects. But I'm now wanting to add multiple levels, where the amount of bread slices resets and increases to make the game more difficult, so I've been trying to learn more about tables to make this happen.
My goal with this code was to be able to add a different number of slices to the bread table each time the game state is triggered, based on the level number. So the 'for i=0,(level+2)' is meant to make it so that the number of slices is the level number plus two, so 3 for level one, 4 for level two, and so on.
But when I run the code below, I don't get any errors, but the bread doesn't even appear. I've definitely added these custom functions to the main code, so I'm not sure where I'm going wrong. Any guidance greatly appreciated as the concepts here are very new to me!

A simple, no-frills implementation of the classic puzzle game. Created for fun in PICO-8 - nothing revolutionary, just 2048
(UPDATE): Added "Time Stop" mechanic! Hold down the X button to temporarily stop new blocks from appearing. You have 32 time-stopped moves total per game. Use them strategically to set up perfect combos!

Drawn to kill
A game where you kill enemies in a note book
Each round gets harder and harder!
Controls
- Steer - Arrow keys
- Shoot - X
Tips & tricks
- Shoot from as far away as possible to get more money
Music
- Tritsch-Tratsch Polka by Johann Strauss II
(Arranged to Pico8 by me)
High Score
- Current High Score: 2385 (held by me)

If anyone beats it, i want a screenshot as proof

Hello!
I'm currently working on a system for loading and saving text files. My end goal is to have an exported binary for my Pico-8 program. This however introduces some limitations, as exported binaries can not import user-editable files from disk. It is however possible to load files that are dropped from a file explorer into the Pico-8 program. To make it easier for users, I want to open the OS file explorer from within Pico-8. Usually this can be done from the Pico-8 terminal by typing folder, however this command does not appear to work from within a cart.
I'm fairly certain this can be done, as the Picocad binary allows the opening of the file explorer.
Appreciate all answers/ suggestions!
This game is about cutting as many leaves as possible in a three-day shift. Each shift gets longer and harder, and you'll have to deal with a lot of bees trying to bother you!
HOW TO PLAY :
like the image above :
-
Cut things using A or X on a controller, or Z or C on a keyboard.
-
It's recommended to play with a gamepad for a better experience.
-
Your goal is to cut the green leaves and the special red ones.
-
Be careful not to cut the blue tulips! They give you points over time as long as you don't touch them.
-
Watch out for the bees and stay away from them.
- Make the most point in a 3 shifts !






1 comment







