FANDOM

dddaaannn, aka Dan Sanderson:

Author of picotool, a Python library for manipulating Pico-8 cartridges.


Using my profile page for a couple of quick CSS tests: kbd style. syntaxhighlight:

v1 = nil
v2 = false
v3 = true
v4 = 123
v5 = 123.45
v6 = "string"
v7 = 7 < 10
v8 = -12
v9 = not false
func()
v10 = func(1, v3, "string")
v11 = { "Monday", "Tuesday", "Wednesday",
        "Thursday", "Friday", "Saturday",
        "Sunday" }
v12 = v11[3]
v13 = {}
v13.x = 100
v13.y = 200
v13["z"] = 300
do
 func()
 v2 = not v3
end
-- Comment
-- do
--  func()
--  v2 = not v3
counter = 10  -- end of line comment
while counter > 0 do
 counter -= 1
 if counter % 2 == 0 then
  func()
 end
 if func(counter) > 900 then
  break
 end
end
repeat
 counter += 1
 if counter % 2 == 0 then
  func()
 end
until counter == 10
if v4 > 0 then
 func(1)
elseif v5 and (v4 < 0) then
 func(-2)
elseif v4 < 0 then
 func(-1)
else
 func(0)
end
for x = 1,10,2 do
 func(x)
 if x % 2 == 0 then
  func(x+1)
 end
end
for x,y,z in foobar do
 func(x)
 if x % 2 == 0 then
  func(x+1)
 end
end
function func(x, y, z)
 local foobar = 999
 if x % 2 == 0 then
  func(x+1)
 end
 return 111
end
local function func2(x, y, z)
 if x % 2 == 0 then
  func(x+1)
 end
end
a = {"hello", "blah"}
add(a, "world")
del(a, "blah")
print(count(a)) -- 2
for item in all(a) do print(item) end
foreach(a, print)
foreach(a, function(i) print(i) end)
x = 1 y = 2 print(x+y) -- this line will run ok
-- Pico-8 shorthand
if (not b) i=1 j=2
a += 2
a -= 2
a *= 2
a /= 2
a %= 2
if (a != 2) print("ok") end
if (a ~= 2) print("ok") end
Community content is available under CC-BY-SA unless otherwise noted.