recursal/Fanatic-Fandom huggingface dataset:
Centering Text

```
textlabel="this is some cool text!!!"

function hcenter(s)
  -- screen center minus the
  -- string length times the
  -- pixels in a char's width,
  -- cut in half
  return 64-#s\*2
end

function vcenter(s)
  -- screen center minus the
  -- string height in pixels,
  -- cut in half
  return 61
end

function \_draw()
  cls()
  print(textlabel,hcenter(textlabel),vcenter(textlabel),8)
end

```
Butlerian Jihad

Creator
 Genre
 Player Count

## Description

The player controls humanitarian rebel Jehanne Butler that must avoid robots that are out to kill her and enslave humanity by influencing them to destroy each other.

## Rules

* Being a turn-based game, with every time Butler moves, the robots will also make a move. Butler can also skip a turn and let the robots advance.
* One of the few defenses Butler has is to influence the robots to collide with each other, or the debris of a former robot. For instance, there could be still-functioning robots to the left of the screen with a space of robot debris in the same path in the middle and Butler is on the right side of the screen. She can just wait out her turns as the functioning robots keep on advancing until they all plow into the square holding the robot debris and end up being destroyed.
* Butler has a displacement belt that can be used to relocate her to a random screen area during a level.
* Butler also has a shield function that can destroy one or more robots; one extra shield unit is gained with every level cleared. However, if Butler relocates to an area of a level that has a robot right next to it and she has at least one shield unit left, the robots will then take a turn, the robot where she landed next to will advance, be destroyed by her shield and she will use up a shield. If a robot touches her with no shield units remaining the game will end.

## Controls

* Use the arrow keys plus the Z key to move Butler.
* Use the Z key to wait out a turn/advance the robots without moving.
* Use the X key to displace to a different area.
* Use the Enter key to pause the game.
Bitwise Operations

Bitwise Operations exist in programming languages as a direct way to modify the binary values, or bits, in a number. Sometimes, it's more efficient or useful to modify the bits of a number rather than performing arithmetic on the number. One example of this is a bitmask where you use the BAND operation to choose several bits to check and ignore the others.

Pico8 has a collection of useful bitwise operations. Keep in mind that, since update 0.2.0 when they were added, the operator forms of the bitwise functions run faster in the simulated CPU than the API Calls do.

## See also

* Math
* APIReference
Qsort

qsort( a, [c,] [l,] [r] )
Sort an array (in-place) via the dual-pivot quicksort algorithm used by most standard libraries.
a

The array to be sorted.

c

The comparator function to be used.
Defaults to a simple less-than comparator: `function(a,b) return a<b end`

l

The left/first index of the range to be sorted. Normally the caller should omit this, allowing it to default to 1.

r

The right/last index of the range to be sorted. Normally the caller should omit this, allowing it to default to `#a`.

This snippet implements the dual-pivot quicksort, which is the algorithm used in most modern languages' standard libraries. It is a very good general-purpose sort function that works well for most data sets and initial conditions. The only case where it performs poorly is when a list is already sorted in (near-)reverse order, as that may cause it to make poor pivot choices.

Typically only the array (a Lua sequence-style table with entries from 1 to #table) needs to be passed. If entries cannot be compared with a simple less-than comparison, a custom comparator function may be passed to do the comparisons.

The last two arguments are not typically provided by the caller, unless only a portion of the array is meant to be sorted. They are normally only used when qsort calls itself again recursively as part of its internal process.

## Examples

```
t = { 4,1,-7,3,-2 }

-- normal ascending sort
qsort(t)
for i=1,#t do print(t[i]) end  -- -7,-2,1,3,4

-- custom ascending sort, based on absolute values
qsort(t, function(a,b) return abs(a) < abs(b) end)
for i=1,#t do print(t[i]) end  -- 1,-2,3,4,-7

```

## Snippet

```
-- qsort(a,c,l,r)
--
-- a
-- array to be sorted,
-- in-place
-- c
-- comparator function(a,b)
-- (default=return a<b)
-- l
-- first index to be sorted
-- (default=1)
-- r
-- last index to be sorted
-- (default=#a)
--
-- typical usage:
-- qsort(array)
-- -- custom descending sort
-- qsort(array,function(a,b) return a>b end)
--
function qsort(a,c,l,r)
	c,l,r=c or function(a,b) return a<b end,l or 1,r or #a
	if l<r then
		if c(a[r],a[l]) then
			a[l],a[r]=a[r],a[l]
		end
		local lp,k,rp,p,q=l+1,l+1,r-1,a[l],a[r]
		while k<=rp do
			local swaplp=c(a[k],p)
			-- "if a or b then else"
			-- saves a token versus
			-- "if not (a or b) then"
			if swaplp or c(a[k],q) then
			else
				while c(q,a[rp]) and k<rp do
					rp-=1
				end
				a[k],a[rp],swaplp=a[rp],a[k],c(a[rp],p)
				rp-=1
			end
			if swaplp then
				a[k],a[lp]=a[lp],a[k]
				lp+=1
			end
			k+=1
		end
		lp-=1
		rp+=1
		-- sometimes lp==rp, so
		-- these two lines \*must\*
		-- occur in sequence;
		-- don't combine them to
		-- save a token!
		a[l],a[lp]=a[lp],a[l]
		a[r],a[rp]=a[rp],a[r]
		qsort(a,c,l,lp-1       )
		qsort(a,c,  lp+1,rp-1  )
		qsort(a,c,       rp+1,r)
	end
end

```
Invasion

Creator
 Genre
 Player Count

## Description

Shoot as many invaders as possible while avoiding their fire.

## Rules

* Shoot invaders! Clearing a screen of invaders will take the player to the next level.
* The invaders move in a formation from side to side; once they reach the edge of a screen the formation will drop down a notch closer to the player’s laser base. The invaders move faster as their numbers are whittled down.
* The invaders start shooting, which being hit by an invader’s fire will cost the player a laser base and the game will end when there are no more bases left in reserve. If any invader reaches the very bottom of the screen, this will also end the game.
* Bunkers can be used as protection from invader fire, although they start taking damage when hit by the player's or alien fire.
* A bonus U. F. O. flies overhead a few times during a level which is worth big points.

## Controls

* Use the Z or X keys to start a game.
* Use the arrow keys to move the laser base.
* Use the Z or X keys to fire.
* Use the Escape or Enter keys to pause the game.
Nowe Momio

**Nowe Momio**- trwa ono od ok. listopada 2015r.

## Różnica

**Stare Momio** - Różnica między nowym a starym momio jest dosyć duża np:

* dodali Momio Plus
* dodali Szafiry
* Jest więcej ubrań
* Można kupić więcej Animo
* Jest mniej Momo
* Jest trochę inna grafika ubrań
* Kiedyś Momo wyglądało tak:
* Kiedyś na starym Momio Emily wyglądała tak:
* Kiedyś Momio nazywało się Skymo
* Dodali pokoje.

* Niedawno, na prośbę użytkowników dodali czat w pokojach
Peek

peek( addr, [n] )
Reads one or more bytes from contiguous memory locations starting at `addr`.
addr

The address of the first memory location.

n

The number of bytes to return. (1 by default, 32767 max.)
The `peek()` function reads and returns one or more bytes from the addressable memory region (0x0000-0x7fff).

See Memory for information about the memory layout.

See `peek2()` for a way to read groups of 16-bit values from two consecutive memory addresses, and `peek4()` to read groups of 32-bit values from four consecutive memory addresses.

## @ operator

The unary-`@` operator added in 0.2.0 performs the same function as `peek(address)` and is now the recommended way to read one byte of memory at a time, as it uses fewer tokens, costs fewer cycles at runtime, and runs on the real host CPU much more efficiently. Simply replace `peek(address)` with `@address`.

## Examples

```
b = peek(0x4300)

b = @0x4300      -- preferred method

delay,interval = peek(0x5f5c, 2) -- assign variables with the btnp() settings

```

## See also

* Memory
* `peek2()`
* `peek4()`
* `poke()`
* `poke2()`
* `poke4()`
* `memcpy()`
* `reload()`
* `cstore()`
* `memset()`
Resume

resume
Resumes execution of an interrupted program.
You execute this system command at the PICO-8 prompt.

The `resume` command resumes execution of a program interrupted by the player pressing the Escape key or the program calling `stop()`.

This command only works if the program uses the game loop. It does *not* resume from the place in the code where the program was interrupted. Instead, it starts a new frame by calling `\_update()`.

The PICO-8 manual describes this command as "flaky." Some carts may have difficulty resuming from an interrupted state because the code that was interrupted may have left global variables in an inconsistent state.

## Examples

```
> resume

```

## See also

* `run`
* `reboot`
* `stop()`
All

all( tbl )
Returns an iterator for all non-`nil` items in a sequence in a table, for use with `for...in`.
tbl

The table to iterate.

*return-value*

An interator function that can be used with `for...in` to iterate over tbl.
The `all()` iterator function is used exclusively with `for...in` to iterate over all elements in a sequence in a table. Each non-`nil` value in the sequence is emitted in sequence order.

Specifically, `all()` starts at index 1, then steps forward through the table until it reaches the final index, emitting only the elements which are not `nil`.

Take care when manipulating the table itself while iterating through it. The `all()` iterator does not track the index, so the only way to delete elements during iteration is to use `del(table, value)`. This will work fine if there are no duplicate values in the table, but if two elements of the table contain the same value, it's possible that you might delete one before the current iteration point and confuse the iterator. The `all()` iterator is capable of recovering after the element at the iteration point is deleted, but not elements before it. If the table might contain duplicates, it is advised to use the `ipairs(table)` iterator, which supplies both index and value, and `deli(table, index)` to delete the element at the current index.

## Examples

```
-- note this is only guaranteed to work correctly with
-- a table that has no duplicate values, except nil gaps
t = {1, 3, nil, 5}
add(t, 7)
add(t, 9)

for v in all(t) do
  print(v)  -- prints 1, 3, 5, 7, 9
end

function no\_primes(t)
  for e in all(t) do
    if is\_prime(e) then
      del(t, e)
    end
  end
end

```

## See also

* Lua
* Tables
* `add()`
* `del()`
* `deli()`
* `foreach()`
* `ipairs()`
* `pairs()`
Load

load filename [breadcrumb] [param]
Loads a cartridge.
filename

Either the name of the cartridge file, a BBS cart ID in the form `"#mycartid123"`, or `"@clip"` to load a cartridge from the system clipboard copied from the BBS.

breadcrumb

When called from within a cart with this parameter, this adds an item to the pause menu to return to the original cart.

param

An arbitrary string value that can be accessed by the loaded cart using `stat(6)`.

When this system command is executed at the PICO-8 prompt, the cart currently in memory is erased and replaced with the loaded cart.

When called from within a running cart, e.g. `load("filename")`, the loaded cart completely replaces the current cart in memory and begins executing immediately.

If the breadcrumb string is provided, a menu option with that text is added to the pause menu of the new cart that reloads the original cart. No state is preserved when following the breadcrumb: the cart is loaded and run from the beginning. The loaded cart can access this string programmatically using `stat(100)`. (See `stat()`.)

If the param string is provided, the loaded cart can access this string value using `stat(6)`. This can be used to pass arbitrary values to loaded carts. As of v0.2.0i, the maximal length of the string is 1024 (longer strings are truncated).

Data can also be passed to and from loaded carts via the general use memory region.

PICO-8 can load cartridges in `.p8` format or `.p8.png` format. If the filename is specified without an extension, PICO-8 assumes `.p8`, even if another file ending in `.p8.png` exists.

If filename is formatted like `"#mycartid123"`, it loads the cart with that ID from the PICO-8 forum. (This requires a connection to the Internet.) The ID can also be for the forum post containing the cart. Only local carts and carts loaded from the forum can load carts from the forum, not carts running in standalone players created through `export`.

If filename is `"@clip"`, PICO-8 attempts to load the contents of the system clipboard as a cartridge. The value on the clipboard must be in the format used by `save @clip`. This is the same format provided by the "Copy" feature of the PICO-8 BBS, meaning cartridges can quickly be transferred from BBS posts into the PICO-8 app.

## Examples

At the PICO-8 prompt:

```
> load demos/jelpi.p8

```

Loading from the clipboard:

```
> load @clip

```

Loading from the forum (network connection required):

```
> load #1234

```

In source code:

```
-- load a cart
load('demos/jelpi.p8')

```

In source code with a breadcrumb menu item back to the original cart:

```
load('demos/jelpi.p8', 'back to menu')

```

## See also

* `folder`
* `ls`
* `save`
* `stat()`
Drop Down

Creator
 Genre
 Player Count

## Description

Help Klossen get home! Collect groceries on the way!

## Rules

* First, a skill level must be chosen: moving Klossen into the hole in the left platform will start the game on the kids level, whereas the right hole will start the game on the normal level. The kids setting is short and at an easier pace whereas the normal setting has a longer course and speeds up.
* The screen starts scrolling once the game starts; Klossen must be moved into holes in platforms as they move upwards. If a platform pushes Klossen all the way up to the top of the screen then the game will end.
* On the way down to his home are various food items that Klossen can collect in order to add to his groceries total at the end.

## Controls

* At the title screen, press either arrow key towards a level selector and drop down a hole in the platform to play the game.
* Use the arrow keys to move (left/right and up to jump).
* Use the enter or p keys to pause the game and/or reset the cart.
* Use the z or x keys to play again at the end of a game.
Pico-8 Wikia

The wiki for PICO-8, the fantasy programmable game console by Lexaloffe Games.

## Welcome to the PICO-8 Wiki

PICO-8 by Lexaloffle Games is a fantasy programmable game console for making, sharing, and playing tiny games and other computer programs (cartridges, or "carts"). The console provides simple built-in tools for creating your own cartridges.

## Quick links

* Getting started
	+ What is PICO-8? (official home page)
	+ How to play games
	+ Getting started making games
	+ Tutorials category

* Community
	+ Forum (BBS) (direct link)
	+ PICO-8 Slack
	+ IRC
	+ PICO-8 Zine
	+ Community category

* Reference
	+ Commands
	+ APIs
	+ Lua
	+ Memory
	+ Configuration
	+ Running PICO-8
	+ P8SCII character set and print control codes
	+ Reference category

## Categories

* Tutorials
* Code snippets
* Games
* Community
* Tools
* Reference
	+ API
	+ Command
Spr

spr( n, [x,] [y,] [w,] [h,] [flip\_x,] [flip\_y] )
Draws a sprite, or a range of sprites, on the screen.
n

The sprite number. When drawing a range of sprites, this is the upper-left corner.

x

The x coordinate (pixels). The default is 0.

y

The y coordinate (pixels). The default is 0.

w

The width of the range, as a number of sprites. Non-integer values may be used to draw partial sprites. Requires h to be supplied as well. The default is 1.0.

h

The height of the range, as a number of sprites. Non-integer values may be used to draw partial sprites. Required if w is supplied. The default is 1.0.

flip\_x

If `true`, the sprite is drawn inverted left to right. The default is `false`.

flip\_y

If `true`, the sprite is drawn inverted top to bottom. The default is `false`.

This operation is affected by the draw state.

## Examples

```
-- draw sprite 1 (1x1) at (60, 60)
spr(1, 60, 60)

-- draw sprite 1 (1x1) at (72, 60), flipped vertically
spr(1, 72, 60, 1, 1, false, true)

-- draw the top-left quarter of sprite 1 at (72, 60)
spr(1, 72, 60, 0.5, 0.5)

-- draw sprite range starting at sprite 16, 3 wide 2 high, at (20, 52)
spr(16, 20, 52, 3, 2)

```

## See also

* Graphics
* Draw state
* `sspr()`
* `pal()`
* `palt()`
Pack

pack( ... )
Creates a table from the given parameters.
...

parameters
Returns a new table with all parameters stored sequentially into keys [1], [2], etc.

The table will also contain a member .n which specifies how many arguments were passed to `pack()`, including nil arguments. This can be used to detect the difference between an argument that was not passed at all and a nil value that was deliberately passed, since the `#` operator stops when it reaches a nil value.

## Examples

```
tbl = pack(x, y, dx, dy)   -- returns {x, y, dx, dy}
print(#tbl)                -- prints "4"
print(tbl.n)               -- prints "4"

tbl = pack(x, y)           -- returns {x, y}
print(#tbl)                -- prints "2"
print(tbl.n)               -- prints "2"

tbl = pack(x, y, nil, nil) -- returns {x, y}
print(#tbl)                -- prints "2"
print(tbl.n)               -- prints "4"

```

 See also

* `unpack()`
Magnetoids

Creator
 Genre
 Player Count

## Description

It's Asteroids in reverse! The player shoots squares, but must combine them all together this time around, rather than break them up.

## Rules

* Shoot the boxes. This has two effects: one, it changes the course of the box, and two, it briefly creates a magnetic shield.
* When there are two or more boxes in the vicinity of each others' shields (when active), this will cause one or more boxes to be absorbed into one box (which will grow with each box it absorbs). The player must combine all boxes to form one giant box (which will then “collapse due to it's unbearable mass”) in order to proceed to the next level.
* Getting hit by a box will cost the player a ship and the game will end when they have no more ships left in reserve.

## Controls

* Use the X or Z keys to start a game.
* Use the left/right arrow keys to turn your ship.
* Use the X or Z keys to shoot.
* Use the Escape or Enter keys to pause the game.
Portola Redwoods State Park

**Portola Redwoods State Park** is a state park in California, located 24.7 miles from Los Gatos.

## Appearances

**Episode 107:** Two days after Sebastian Torres' disappearance, Tannis Braun searches Portola Redwoods for Sebastian, accompanied by Alex Reagan. Tannis claims he felt a "pull" towards the park after meeting with Sebastian's mother and examining his belongings. However, their search is unsuccessful.

At noon next day, Sebastian is found by a hiker in an abandoned cabin within the park.

## References

1. ↑ https://www.parks.ca.gov/?page\_id=539
2. ↑ Google Maps
3. ↑ The Black Tapes Podcast, "Episode 107 - Cabin Fever"
4. ↑ http://theblacktapestranscripts.weebly.com/episode-107-cabin-fever.html
Next

next( tbl, [key] )
A stateless iterator of key-value pairs for all elements in a table.
tbl

The table.

key

The current key.

The `next()` function is the stateless iterator that underpins `pairs()`, as used in `for k,v in pairs(t)` to iterate over all elements in a table. It takes the table and the current key and returns the next key/value pair, or nil if there isn't one. The key passed in may be omitted or nil to retrieve the first key/value pair of the table.

Under normal conditions, `next()` is not referred to directly, instead being supplied under the hood by `pairs()`. However, it has its uses. For instance, it can be called with just the table to get the first key/value pair, and thus determine quickly whether or not the table is empty:

```
function empty(tbl)
  -- note that we compare to nil, since 'false' is a legal key
  return next(tbl) == nil
end

```

As noted with `pairs()`, this will iterate over every value in the table, not just those with sequential indexes. It can return keys and values for tables being used as mappings (dictionaries) or objects.

Also note that the concept of "next" here is based on the next value in the internal representation of the table (an unordered hash table). This does not guarantee the order in which the results are returned, only that you will see all entries in the table exactly once.

## Examples

```
t = {n=42, x=100, y=200}

-- write "for k, v in pairs(t) do ... end" manually
local k, v
while true do
  k,v = next(t, k)
  if(k == nil) break
  print(k..': '..v)
end

-- output:
-- x: 100
-- y: 200
-- n: 42

```

## See also

* Lua
* Tables
* `add()`
* `all()`
* `del()`
* `foreach()`
Deprecated

In programming, a *deprecated* function is one which is still available, but which you should not use in new programs.

Keeping a function around, but deprecating it, is usually done to maintain backwards-compatibility with old programs.

Usually, a deprecated function is replaced with one or more new functions that do the same thing.

For instance, in the PICO-8 API, the original mapdraw() function was renamed to just map() for the sake of simplicity and consistency. The original function name was deprecated, but not removed, to avoid breaking old carts. However, new carts should use `map()`.

Occasionally, a function needs to be removed entirely. In these cases, the function may be deprecated for a period of time before it is removed. This is done so people who use the function have an opportunity to change their code before the function disappears and breaks it.
1D Array to 2D Grid

When making games like "Tetris", "Candy Crush", ect some might use 1D arrays. Where coordinates or data are stored in a single value. "I" stands for iterator. It is essentially the x,y of 1D arrays. But, sometimes when working with 1D arrays we find ourselves needing to translate 1D positions to 2D positions. These functions do so:

```
--Variables sizx/sizy represent the size of the grid.
sizx=3
sizy=3

--1D to 2D
x=((i-1)%sizx)
y=flr((i-1)/sizy)

--2D to 1D
i=((x2)%sizx)+(y2)\*sizy

```
IPairs

*New in PICO-8 0.2.0.*

ipairs( tbl )
Returns an iterator of index-value pairs for all elements in a table, for use with `for...in`.
tbl

The table.

The `ipairs()` iterator function is used exclusively with `for...in` to iterate over all elements in the indexed sequence (array-like) portion of the table. It emits the index and value together, which you can assign to variables in the `for` loop:

```
for i, v in ipairs(tbl) do
  -- ...
end

```

This iterator produces only the values in the table which are considered part of its indexed sequence. It will not produce values associated with non-numeric keys, and it will not produce values for any indices greater than `#table`.

It is guaranteed that the indices will be produced in ascending order.

## Examples

```
t = {111, 222, 333}
for i, v in ipairs(t) do
  print(i..': '..v)
end
-- 1: 111
-- 2: 222
-- 3: 333

t = {123, 456, n=42, x=100, y=200}
for i, v in ipairs(t) do
  print(i..': '..v)
end
-- 1: 123
-- 2: 456

```

## See also

* Lua
* Tables
* `add()`
* `all()`
* `del()`
* `foreach()`
* `next()`
* `pairs()`
Rect

rect( x0, y0, x1, y1, [col] )
Draws an empty rectangle shape.
x0

The x coordinate of the upper left corner.

y0

The y coordinate of the upper left corner.

x1

The x coordinate of the lower right corner.

y1

The y coordinate of the lower right corner.

col

The color of the rectangle border. If omitted, the color from the draw state is used.

This draws a rectangle shape parallel to the screen borders.

It's important to note that the coordinates are *inclusive*, which is to say PICO-8 will render pixels at the right and bottom coords. In many APIs, `x1` and `y1` would be the first pixels which are *not* drawn, but on PICO-8, they are the last pixels which *are* drawn.

## Examples

```
-- draw a border around the whole screen
rect(0, 0, 127, 127, 1)

-- draw a border inset by 16 pixels
rect(16, 16, 111, 111, 1)

-- draw three empty white rectangles at random locations and sizes
color(7)
for x=1,3 do
  rect(rnd(128), rnd(128), rnd(128), rnd(128))

end

```

## See also

* Graphics
* Draw state
* `circ()`
* `circfill()`
* `line()`
* `rectfill()`
Sanic

Sanic, or Sanic the Hedgehog, was the first one to appear in the Crossuniverse. He is the fastest thing to ever exist, able to go 12 times the speed of light in his base form, and up to 500 MLGs (1 MLG is 10 times the speed of light) in his super sanic form. In order to get into his super sanic form, he must have all seven Chaos Doritos. He also has a "sanicball" form for both his base and super sanic forms.
Run

run [str]

run( [str] )
Runs the current cartridge from the start of the program.
str

A "breadcrumb" string, as if passed by a calling cartridge.

When run as a system command at the PICO-8 prompt, this starts the program. If the program was running previously, `run` resets the game state and starts from the beginning.

When `run()` is called as a function, the runtime environment resets and the program executes from the beginning.

A string may be passed as a "breadcrumb" that the cartridge can find in `stat(6)`. Breadcrumbs are usually used when one cartridge loads another and wishes to tell the other where it came from. This is a way to simulate that, or to retain the existing breadcrumb if the cartridge chooses to re-run itself.

## Examples

At the PICO-8 prompt:

```
> run

> run this is my breadcrumb

> run "this is my breadcrumb"

```

Note that quotes are optional and both of the latter examples produce the same result.

In source code:

```
-- reset the program
run()

-- reset the program with a breadcrumb
run("this is my breadcrumb")

-- reset the program and preserve the current breadcrumb
run(stat(6))

```

## See also

* `resume`
* `reboot`
* `shutdown`
* `stat()`
Moon Recon

Creator
 Genre
 Player Count

## Description

The player's ship moves through a constantly scrolling moon landscape while reacting to dangers.

## Rules

* Moving right will increase the speed of the player's ship while moving left will decrease it. There is no way to stop moving.
* Dangers come from above with U. F. O.s that shoot at the player while large rocks appear in their path.
* Shooting upwards can destroy U. F. O.s while shooting forward (/to the right of the player's ship) will destroy rocks.
* If the player's ship is hit by a bomb dropped by a U. F. O. or collides with a rock it will destroy their ship and the game will end when there are no more remaining ships.

## Controls

* Use the z key to start a game.
* Use the p or enter keys to pause the game or reset the cart.
* Use the left and right arrow keys to move.
* Use the z key to fire upwards.
* Use the x key to fire to the right.
Holdframe

holdframe( )
Prevents the physical display from showing changes to video memory.
This internal, undocumented function is how the PICO-8 application prevents changes to video memory from being shown on the physical display.

Normally, even in the absence of a proper `_update()`/`_draw()` loop or manual calls to `flip()`, the displayed image will periodically be automatically refreshed to show changes made to video memory. Many demos and tweetcarts take advantage of this.

To disable this automatic refresh, `holdframe()` may be called. Afterwards, the physical display will not show any changes made to video memory.

Automatic periodic refreshing will be re-enabled after the next call to `flip()`.

This has multiple uses. One is to prepare a very complex frame over a long period of time before presenting it. Another is to disable the interrupt that copies the video ram to the output device and therefore avoid unwanted interference when timing/profiling code.

## Warning

While `holdframe()` *is* mentioned in the official documentation, it is only mentioned in the change log as an addition at a very early stage. It is otherwise undocumented. As an undocumented function, it cannot be relied on for a game. Its functionality may change or be removed in future versions. Still, some may find a pragmatic use for it in tools or demos. Just be aware that you use it at your own risk.

## Examples

```
-- this displays a colorful random noise pattern...
while true do
  pset(rnd(128),rnd(128),rnd(16))
end

-- ...however, even though this \*draws\* the same noise,
-- it \*displays\* nothing until the program is interrupted
holdframe()
while true do
  pset(rnd(128),rnd(128),rnd(16))
end

```
Tengu Ivan

Tengu Ivan is a former Tengu soldier (a special unit) who, upon entering the Crossuniverse, was hired by the Dark Community in exchange for some money. He is very agressive and likes to hurt people, so he assigned to train the soldiers and to go on stealth missions, often to sabotage his enemies and cause some carnage.

## Equipment and Skills

He is equipped with a one-edged sword (probably a katana) which is made of a special kind of alloy. It makes it super lightweight and increases its cutting power. His other weapon is a FN P90, a special french submachinegun. The weapon is heavily modified to carry more ammo and to be even lighter.

Other than his weapons, Ivan wears a modern battle exoskeleton which raises his physical skills threefold, making him 3x more agile, strong, flexible and athletic. He can jump 2 meters and can pack kicks as strong as a kangaroo. His perception time is much better than the average human and, with enough skill and luck, he can deflect bullets if he is precise enough.
Pairs

pairs( tbl )
Returns an iterator of key-value pairs for all elements in a table, for use with `for...in`.
tbl

The table.

The `pairs()` iterator function is used exclusively with `for...in` to iterate over all elements in a table. It emits the key and value together, which you can assign to variables in the `for` loop:

```
for k, v in pairs(tbl) do
  -- ...
end

```

This iterator produces every value in the table, not just those with sequential indices. It can produce keys and values for tables being used as mappings (dictionaries) or objects.

Be warned that results are not produced in any guaranteed order. Some small tables may seem to iterate in order, but that is purely coincidental behavior which should *not* be relied upon.

## Examples

```
t = {111, 222, 333}
for k, v in pairs(t) do
  print(k..': '..v)
end
-- 1: 111
-- 2: 222
-- 3: 333

t = {n=42, x=100, y=200}
for k, v in pairs(t) do
  print(k..': '..v)
end
-- x: 100
-- y: 200
-- n: 42

```

## See also

* Lua
* Tables
* `add()`
* `all()`
* `del()`
* `foreach()`
* `ipairs()`
* `next()`
United Kingdom of Penwardia

The United Kingdom of Penwardia is a huge, safe nation of Planet Pendivania remarkable for its public floggings, daily referendums, and keen interest in outer space. The hard-nosed, hard-working population of 395 million Penwardians have some civil rights, but not too many, enjoy the freedom to spend their money however they like, to a point, and take part in free and open elections, although not too often.

## Economy

The thriving Penwardian economy, worth 47.5 trillion money a year, is broadly diversified and led by the Tourism industry, with major contributions from Information Technology, Arms Manufacturing, and Trout Farming. Average income is an impressive 120,158 Starbucks, and evenly distributed, with the richest citizens earning only 2.4 times as much as the poorest.
Atan2

atan2( dx, dy )
Calculates the arctangent of dy/dx, the angle formed by the vector on the unit circle. The result is adjusted to represent the full circle.
dx

The horizontal component.

dy

The vertical component.

*return-value*

The angle of the line from 0,0 to dx,dy.
The `atan2()` function calculates the arctangent (the inverse tangent) of the ratio of two numbers, dy/dx. Where dx is a change in horizontal position and dy is a change in vertical position, the arctangent is the angle formed by the line from the center of the circle to that position.

PICO-8 adjusts the arctangent value based on the signs of dx and dy such that every angle of the circle is represented. For example, `atan2(1, 1)` is `0.875` (7/4 pi radians, or 315 degrees), and `atan2(-1, -1)` is `0.375` (3/4 pi radians, or 135 degrees). Similarly, `atan2(0, 1)` is `0.75`.

The Wikia articles on sin() and cos() establish a convention where the angle runs clockwise and sine values maintain the traditional orientation, e.g. `sin(0.125)` is `-0.7071` (negative goes down):

Using this convention, you must invert the sign of dy to understand the result of `atan2()`.

The official PICO-8 documentation use the alternative convention, where angles run counterclockwise and `sin()` is simply understood to return the negative of the traditional result. This convention allows the arguments to `atan2()` to be understood as changes in screen coordinates (increasing y values go down). The two conventions are mathematically equivalent.

## Examples

```
print(atan2(1, 0))    -- 0
print(atan2(1, 1))    -- 0.875
print(atan2(0, 1))    -- 0.75
print(atan2(-1, 1))   -- 0.625
print(atan2(-1, 0))   -- 0.5
print(atan2(-1, -1))  -- 0.375
print(atan2(0, -1))   -- 0.25
print(atan2(1, -1))   -- 0.125

-- longer vector uses the ratio
print(atan2(99, 99))  -- 0.875

-- special case: dx=0, dy=0
print(atan2(0, 0))  -- 0.25

```

## See also

* Math
* `cos()`
* `sin()`
Dark Community

The Dark Community is a powerful and influent criminal organization in the Lovecraftian World, mostly active at the Lovecraftian Country. It's main objective is to enslave the entire Lovecraftian World by leading a mass robot revolution. It's leaders are Boomer Kuwanger, Zero, Sigma and Tengu Ivan. It curently has over five million members worldwide, making it a global threat. It's obviously classified as a terrorist organization.

## Philosophy

The Dark Community does not, unlike the Mavericks, believe in robotic supremacy, but rather thinks the world is full of corruption and should be "rebooted". It tries to follow a very rational mindset and some members of the organization use this as an pathetic excuse for their own philosophies, such as Sigma, who believes in robot supremacy, and Zero, who wants to get his revenge on X.

## Members

The organization is currently composed of four leaders and five million members worldwide. The leaders are currently:

* **Boomer Kuwanger****:** Chef of everything. Plans the attacks, manages the resources and hires members.
* **Sigma**: Funds the organization and provides technology. Also plans the attacks and leads the laboratories.
* **Zero:** Goes around hiring people and also leads the attacks.
* **Tengu Ivan**: Leads the attacks, trains the soldiers and sabotages enemies.
Sset

sset( x, y, [c] )
Sets the color value of a pixel on the sprite sheet.
x

The x coordinate on the sprite sheet.

y

The y coordinate on the sprite sheet.

c

The color value to set. If unspecified, the color of the current draw state will be used.

This is similar to `pset()` except instead of the graphics buffer, it sets the color value to the sprite sheet. The sprite sheet is treated as a single canvas 128 pixels wide and 128 pixels high.

If the bottom half of the sprite sheet is used for map data, `sset` will modify map data values for that region. Prefer `mset()` for setting map data.

Drawing to the sprite sheet changes the data in memory, but does not change the cartridge. A program can restore the original data from the cartridge with `reload()`, and can save the modified data to the cart with `cstore()`. See Memory for information about the memory addresses to use.

## Examples

```
sset(10, 10, 7)      -- sets (10, 10) to white
print(sget(10, 10))  -- prints 7

```

## See also

* Graphics
* `fget()`
* `fset()`
* `mget()`
``* `mset()`
``* `pget()`
``* `pset()`
``* `sget()`````````
Alice Kermode

**Alice Kermode** is a professor of architecture at the University of Bath, with deep knowledge of Bath folklore. Reveals the field Percival Black frequented was adjacent to a cave that’s popular with local pagans. Also reveals that the University never had a music department.

## References

1. ↑ https://www.reddit.com/r/PNWS/wiki/characters#wiki\_episode\_11
Brutus

Brutus is a strong sailor that came from the Popeye's dimension. There, he was a bully who always tried to steal Popeye's girlfriend, until he went into the sea for an expedition and got lost. A huge storm emerged and soon Brutus' ship was gone. He then went into a giant whirlpool and somehow woke up in the Crossuniverse. The whirlpool was part of the "Great Crossover" and eventually got bigger and bigger and sucked all Popeye's dimension's characters into the Crossuniverse.

## Powers

Although he doesn't have any supernatural power whatsoever, Brutus has superhuman strenght and can easily pick heavy objects up. This is because of his intense training before becoming a sailor. His strenght also grants him superior resistance and endurance.

## Current Life

Since his appearance in the Crossuniverse, he began a long quest to discover his purpose on that world, no longer wanting to be the villain. He currently travels the Lovecraftian World seas hunting down pirates. He created the Spearfish Squad to aid him in his quest.

## Trivia

* SHRIMP!
* He hates shrimps.
* He once worked on a zoo
Rectfill

rectfill( x0, y0, x1, y1, [col] )
Draws a filled-in rectangle shape.
x0

The x coordinate of the upper left corner.

y0

The y coordinate of the upper left corner.

x1

The x coordinate of the lower right corner.

y1

The y coordinate of the lower right corner.

col

The color of the rectangle and fill. If omitted, the color from the draw state is used.

This draws a rectangle shape parallel to the screen borders.

It's important to note that the coordinates are *inclusive*, which is to say PICO-8 will render pixels at the right and bottom coords. In many APIs, `x1` and `y1` would be the first pixels which are *not* drawn, but on PICO-8, they are the last pixels which *are* drawn.

## Examples

```
-- fill the whole screen, as if we called cls(1)
rectfill(0, 0, 127, 127, 1)

-- fill the center 96x96 portion of the screen
rectfill(16, 16, 111, 111, 1)

-- draw three filled-in white rectangles at random locations and sizes
color(7)
for x=1,3 do
  rectfill(rnd(128), rnd(128), rnd(128), rnd(128))
end

```

## See also

* Graphics
* Draw state
* `circ()`
* `circfill()`
* `line()`
* `rect()`
Magna Centipede

Magna Centipede is a powerful robot which came from the Megaman Universe into the Crossuniverse. It was originally a simple Maverick until it broke free of Sigma's control and escaped. It was dragged to the Crossuniverse after suffering an accident in its base and almost losing its life. It current lives in the Lovecraftian World and fights against the Dark Community. It fights using ninja techniques and can easily defeat unprepared fighters.

## Story

Magna Centipede was originally a Maverick Hunter, until it was captured by Sigma's forces and converted into a Maverick. After being defeated in combat, it regained its consciousness again was free from Sigma's control, however, it had its base blown up by X. The explosion was so powerful, it created some sort of portal which dragged Magna Centipede into the Crossuniverse.

Confused, Magna Centipede set of in a quest to discover its use in that new universe. It landed in the Lovecraftian World and tried to find something interesting to do there. It got a house in Lovecraftian Country and began working there in the police department of Arkham. It was there that Magna discovered the secret underworld created by the Dark Community, a powerful criminal organization led by Boomer Kuwanger planning to enslave the entire Lovecraftian World using robots. Magna Centipede still fights the organization, in hope of eventually defeating.

## Powers

It is a very skilled fighter and can easily defeat one in combat. It has the ability to throw magnetic shuriken and can arc them in whataver way it wants. This is all due to his wonderful ability to create magnetic fields using its own will and can even attract metallic beings into its tail. It also uses its tail as a fifth limb, both for climbing and for attacking. It can also move very fast in a short period of time, giving the effect it is "teleporting". Don't mess with it!
Mario (SMG4)

Mario is a fat Italian Plumber who was corrupted by the One Spaghetti (One Spaghetti to rule them all). He became

corrupted when Mario and Luigi found the One Spaghetti which two of them fight over the spaghetti, causing Mario to strangle Luigi to death. His body shape changes, making him slim. He appeared in the Crossuniverse when he lived in the cave for 400 years, which the cave was sucked into the portal.

## Life in the Crossuniverse

When he was living in the cave, he met the member of The Three Finns named the Anime Finn, which he started making riddles to see if Anime Finn fails, then Anime Finn would get eaten by him, if the Anime Finn wins, then he will tell Finn his life story. However, Anime Finn beated him in the riddles, making him tell his past life. Anime Finn later punched him in the crotch in the middle of the story, causing Anime Finn to steal the One Spaghetti from him and leaves the cave. Mario started looking for his precious spaghetti everywhere for eternity.
Deli

deli( table, [index] )
Removes the element at the given index of a sequence in a table.
table

The table.

index

The index for the value to be removed.

The deli() function removes the value at the given index of a sequence. All subsequent values in the sequence shift down by one slot to keep the sequence contiguous.

The deli() function returns the object being removed. This can be ignored, tested it to see if the removal was successful, or used as needed.

If the index is not supplied, it is assumed to be `#table`, meaning the last element in the sequence. This means a stack can be easily emulated by using `add(s,v)` to push and `v=deli(s)` to pop.

## Example

```
t = {1, 2, 4, 3, 4}
deli(t, 5)  -- t = {1, 2, 4, 3}
deli(t, 3)  -- t = {1, 2, 3}

```

## See also

* Lua
* Tables
* `add()`
* `del()`
* `all()`
* `foreach()`
* `pairs()`
* `ipairs()`
Han Solo

Han Solo is a smuggler, anti-heroic smuggler with a heart of gold, and an inhabitant of the Crossuniverse. He, along with Chewbaca were brought to the universe. They made permanent residence, and ended up doing what they did best: smuggling. He, along with Chewbaca live in his ship the millennium falcon.
The Ultimate Crossover Wikia

<hero description="This wiki is a collab fanfiction/RP in which every fictional universe crosses over." imagename="" cropposition=""></hero>

## Welcome to the The Ultimate Crossover Wikia

This wiki is a collab fanfiction/RP in which every fictional universe crosses over.You can add with freedom your favorite characters in here to add more to the crossover. This includes anime, cartoon, videogame, **ANY** fictional character may be added here. Feel free to contribute.

Here are some pages to get you started:

The Ultimate Crossover Wikia:FAQ

Board:Roleplays

Plot

## Rules

The rules are applied both to the wikia itself and to the chat.

1. Do not insult other users.
2. Do not swear
3. Do not spam
4. If you're going to advertise, ask for permission
5. Make use of good grammar, please
6. Don't create pointless pages.
7. Do not harass other users.
8. Do not wage edit wars
9. Respect everybody
10. **Please,** categorize your pages. You can create new categories, just don't swarm the wikia with hundreds of useless categories.

## Tasklist

Uncompleted tasks have a \* next to them.

* Have 10 pages
* Have 25 pages
* Have 50 pages \*
* Have 75 pages \*

## Latest activity

Photos and videos are a great way to add visuals to your wiki. Find videos about your topic by exploring Wikia's Video Library.

File:Placeholder
Rawset

rawset( tbl, member, value )
Write to a table member, bypassing metamethods
tbl

The table whose member to modify.

member

The member to modify.

value

The member's new value.

When creating things like class objects, one often overrides metamethods like `__index` and `__newindex` with custom code, but might then need to write directly to the table without going through those overrides. This can be done with `rawset()`.

## See also

* `setmetatable()`
* `getmetatable()`
* `rawget()`
* `rawlen()`
* `rawequal()`
* Metatables
* Tables
* Lua
Herobrine

Herobrine is a mysterious ghost-like being that upon entering the Crossover Universe went to the darkest and most desolate planet he could find. His Enemies, The Players, led by Steve went to a Earth-like

world where they felt at home. Herobrine and the other Minecraftians live in the same galaxy, which is yet to be named.
Flash

The Flash is a superhero who onced lived in one of the DC comics universes, until he went too fast and ended up in The Crossover Universe. Since he became stranded here he met Tony Stark (This Tony never became Iron Man) a genius inventor. Tony and Flash decided to build a ship and explore this wondrous universe. Now they are mapping the galaxies while also fighting off Space Pirates.
X

X is one of the most powerful robot reploids in the entire Lovecraftian World. When he came to the Crossuniverse, his cyberbrain was heavily modified for some reason and his personality was completely lost. He behaved like a complete sociopath and almost killed Zero, who was his best friend. He can absorb the powers of the ones he defeated and apply them to his buster, therefore, having a very varied arsenal.

## Story

Upon arrivng at the Crossuniverse, X was heavily modified for some reason and attempted to murder Zero, but failed and retreated. He was then hired by the Arkham police department and works alongside Magna Centipede to defeat the Dark Community. Because of this, Zero considered X a traitor and joined the Dark Community so he could get revenge on X.

X currently has a peaceful "friendship" with Magna Centipede, which is basically him not wanting to mess with Magna Centipede's life. He is a nomadic robot and wanders the streets of Arkham in search of Dark Community members to capture them. He is well-known for faking attacks just so he can kill those members.

## Skills

He is a powerful reploid and is just as powerful as Zero.

### Passive Skills

* **Fearless:** He doesn't feel fear. This can be quite a problem, sometimes, but helps him in dealing against intimidating enemies that are in fact weak.
* **Now i got you power:** His catchphrase, for some reason. He can absorb the powers from his enemies and use them.

### Active Skills

* **Storm Tornado:** He shoots a very powerful wind tunnel. Very damaging and can push objects or creatures to far away.
* **Shotgun Ice:** Fires an ice bullet that will explode into more ice bullets.
* **Ultra Megaman Combo:** He can become Megaman and perform some weird combo. It's his most damaging attack. Good for cleaning rooms. To do it, he summons some robotic dog, a bird and a weird red Met.
Luigi

Luigi is the brother of Mario, and an inhabitant of the Crossuniverse. Ever since Luigi was brought to the Crossuniverse, he dedicated a large portion of his life to ending Weegee. He sometimes goes a bit insane trying to kill Weegee, which often freaks out his brother Mario. Despite this, Mario helps him kill Malleo and Weegee. He, other then that, it basically the same.
Crossuniverse

The Crossuniverse is currently a complex place formed by the merging of numerous other universes' characters and places. All the planets and starts within came from other universes and got all mixed up. There, many characters live in peace and sometimes wage war against each other. The Crossuniverse is made of numerous galaxies, such as the Milky Way, Andromeda, Hoag's Object and many others. Since the place is so vast and the number of fictional characters is almost infinite, it's hard to catalogue each one of them.
Pac-Man

Pac-Man is-well, hard to explain. He's a yellow ball that eats yellow dots while fighting enemies such as ghosts. His powers range from eating stuff to launching energy balls to...head-butts?

He was one of the first videogaming icons, being well before Mario an acclaimed "hero"

There are two different Pac-Mans, the Pac-Man World one and the Pac-Man and the Ghostly Adventures one, the one in this page is the first one.