Code Snippets Lua

Short texts Lua 🧑‍💻 Code snippets Lua ✍️ Reading lists Lua 👀

Pico-8 Conditionals Puzzle

function _init() x = 64 y = 64 end function _update() if btn(0) then x = 1 end if x > 128 then x = 0 end end function draw() cls() spr(1, x, y) end

Pico-8 Input & Output Prompt

function _init() end function _update() end –code that displays things function _draw() cls() spr(1, 64, 64) print(“hello!”, 64, 50) end

Pico-8 Button Sprite Control

function _init() x = 64 y = 64 end function _update() if btn(0) then x = x + 1 end if x < 0 then x = 128 end end function _draw() cls() spr(1, x, y) end

Pico-8 Input & Output Puzzle

function _init() end function _update() end –code that displays things function _draw() cls() spr(64, 64) print(“hello!” end

Minimal rc.lua example

— Path: ./utils/init.lua return { powerline = require(“utils.powerline”); } — Path: ./utils/powerline.lua local wibox = require(“wibox”) local gears = require(“gears”) –[[ — These are the right ones local flipped_arrow = function(cr, width, height) local shape = gears.shape.transform(gears.shape.rectangular_tag) :translate(width, height) :rotate(math.pi) shape(cr, width, height) end local flipped_powerline = function(cr, width, height) local shape = gears.shape.transform(gears.shape.powerline) :translate(width, […]