This file contains hidden or 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
| --!strict | |
| local kOp = { ['v'] = 1, ['^'] = 2, ['>'] = 3, ['x'] = 4, ['='] = 5 } | |
| export type OpCode = { ret: number, a: number, b: number, op: number } | |
| export type State = { | |
| var: (string) -> number, | |
| reg: () -> number, | |
| emit: (ret: number, a: number, b: number, op: number) -> (), |
This file contains hidden or 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
| --!nolint | |
| local FLAG_BRANCH = 1 | |
| local FLAG_LEAF = 0 | |
| local Bvh = {} | |
| Bvh.__index = Bvh | |
| local function safe(x) | |
| -- safe epsilon |
This file contains hidden or 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
| -- Xml.lua | |
| -- Parses xml files | |
| -- poopbarrel/magicoal_nerb :^) | |
| -- This parser makes a few assumptions about our data: | |
| -- * element tags are not separated by whitespace | |
| -- * no comments | |
| local Stack = require("Stack") | |
| local ffi = require("ffi") |
This file contains hidden or 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
| --!strict | |
| local function decodePair(pair: number): (number, number) | |
| -- Get the vertex A and B | |
| return bit32.rshift(pair, 16), bit32.band(pair, 0xFFFF) | |
| end | |
| local function encodePair(a: number, b: number): number | |
| -- Encode A and B | |
| return bit32.bor(bit32.lshift(a, 16), b) | |
| end |
This file contains hidden or 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
| using System; | |
| using System.Collections.Generic; | |
| public class JsonVariant { | |
| // Referent | |
| public JsonObject referent = null; | |
| // Floating point number | |
| public float number; |
This file contains hidden or 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
| using System; | |
| using System.Collections.Generic; | |
| // Xml element | |
| public class XmlElement { | |
| // Current XML tag | |
| public string tag; | |
| // Current XML body | |
| public string body; |
This file contains hidden or 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
| --!strict | |
| -- Animate.lua | |
| -- magicoal_nerb/poopbarrel :3 | |
| local AnimateScriptKeymap: {[string]: string} = { | |
| Climbing = "climb", | |
| Freefall = "fall", | |
| Running = "run", | |
| Jumping = "jump", |
This file contains hidden or 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
| --!strict | |
| local Queue = require("./Queue") | |
| local Octree = {} | |
| Octree.__index = Octree | |
| export type OctreeNode = { | |
| -- nodes expect 8 children if childIndex != 0 | |
| min: vector, | |
| max: vector, |
This file contains hidden or 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
| --!strict | |
| -- Buffer | |
| -- magicoal_nerb :P | |
| local Buffer = {} | |
| Buffer.__index = Buffer | |
| export type Buffer = typeof(setmetatable({} :: { | |
| data: buffer, |
This file contains hidden or 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
| --!strict | |
| -- AVL Tree implementations based on the mit ocw lecture videos | |
| -- poopbarrel/magicoal_nerb :^) | |
| local Queue = require("./Queue") | |
| local Avl = {} | |
| Avl.__index = Avl |
NewerOlder