This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
love.graphics.setDefaultFilter("linear", "linear", 16) | |
function love.load() | |
love.window.setMode(800, 600, { msaa = 0 }) | |
end | |
local triCanvas = love.graphics.newCanvas(2*1792, 2*828, { msaa = 8 }) | |
local function mkCanvas() | |
triCanvas:clear() | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef ZIPCONTAINER_H | |
#define ZIPCONTAINER_H | |
#include <utility> | |
template<typename V1, typename V2> | |
class ZipContainer { | |
private: | |
V1 &cRef1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extract :: (a -> Bool) -> [a] -> (Maybe a, [a]) | |
extract _ [] = (Nothing, []) | |
extract pred (x:xs) | |
| pred x = (Just x, xs) | |
| otherwise = (x:) <$> extract pred xs | |
data Trie a = Node { datum :: Maybe a | |
, children :: [Trie a] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local sqrt = math.sqrt | |
local cos, sin = math.cos, math.sin | |
local targetStep = 0.1 -- Determines targeting accuracy, lower is better (but slower) | |
local function targetAngle(missile, target) | |
local px = missile.pos.x | |
local py = missile.pos.y | |
local vx = missile.vel.x | |
local vy = missile.vel.y | |
local am = missile.accel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local cursor = require("ui.cursor").new() | |
local running = true | |
local env = { | |
rax = 0, | |
rbx = 0, | |
rcx = 0, | |
rdx = 0, | |
rsi = 0, | |
rdi = 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local exp = 5 | |
local frac = 3 | |
local args = {...} | |
if args[1] then exp = tonumber(args[1]) end | |
if args[2] then frac = tonumber(args[2]) end | |
local bits = {0} | |
for i = 1, exp do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "SDL.h" | |
#include "SDL_gpu.h" | |
#include <stdio.h> | |
#define WIDTH 280 | |
#define HEIGHT 160 | |
#define SCALE 3 | |
bool running = true; | |
bool doScale = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- vim: syntax=lua | |
-- luacheck: globals loadRemote getRemote fs loadstring peripheral | |
-- Load required libs / files | |
local surface = (function() | |
local surface = { } do | |
--[[ | |
Surface 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local complex = {} | |
do | |
function complex.init(a, b) | |
local c = {real = a, imag = b} | |
setmetatable(c, {__index = complex, | |
__add = complex.add, | |
__sub = complex.sub, | |
__mul = complex.mul, | |
__div = complex.div, | |
__pow = complex.pow, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
USAGE: pproc <inputFile> [outputFile] | |
If outputFile is not specified, pproc will write output to this path: inputFile .. ".lua" | |
]] | |
local args = { ... } |
NewerOlder