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 | |
| -- BK trees are used for fast string lookup queries | |
| -- And yea u have to use levenshtein | |
| -- Basically, I just knocked down a few constants | |
| -- so it is marginally faster than most implementations. | |
| -- But, asymptotic performance is basically the same so yeah | |
| -- https://gist.github.com/magicoal-nerb/6c91120e671d557de59e6d87e6617868 |
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 | |
| -- yet another queue implementation :P | |
| -- magicoal_nerb | |
| local Queue = {} | |
| Queue.__index = Queue | |
| export type Queue<T> = typeof(setmetatable({} :: { | |
| data: { T }, |
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 Set = {} | |
| Set.__index = Set | |
| export type Set<T> = typeof(setmetatable({} :: { | |
| data: { [T]: boolean }, | |
| }, Set)) | |
| function Set.new() |
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 | |
| -- yet another bvh implementation :P | |
| -- magicoal_nerb | |
| local Queue = require("./Queue") | |
| local Bvh = {} | |
| Bvh.__index = Bvh |
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 | |
| -- PriorityQueue.lua | |
| -- me when the queue is my priority | |
| -- also made with lectures from mit ocw | |
| -- magicoal_nerb/poopbarrel | |
| local PriorityQueue = {} | |
| PriorityQueue.__index = PriorityQueue |
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 |
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
| -- Stack.lua | |
| -- Last in, first out | |
| -- poopbarrel/magicoal_nerb :^) | |
| local Stack = {} | |
| Stack.__index = Stack; | |
| function Stack.new(capacityPow) | |
| local mask = bit.lshift(1, capacityPow) - 1 | |
| -- create an array beforehand so lua doesn't |
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 | |
| --!native | |
| -- Chunk.luau | |
| -- Uses a binary greedy mesher to chunk | |
| -- everything together. | |
| -- poopbarrel/magicoal_nerb | |
| local CHUNK_FACES: { Vector3 } = { | |
| Vector3.xAxis, |
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 | |
| -- another quake movement reimplementation i suppose | |
| -- magicoal_nerb :P | |
| -- Physics | |
| local XZ: Vector3 = Vector3.new(1.0, 0.0, 1.0) | |
| local CAPSULE_FLOOR_ANGLE: number = 0.7 | |
| -- Convars |
NewerOlder