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
| class_name script_lex | |
| # magicoal_nerb :3 | |
| func _init(data: String) -> void: | |
| self._str = data | |
| self._cursor = 0 | |
| self._lexemes = [] | |
| self._lines = [] | |
| _lex() |
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
| local ReplicatedStorage = game:GetService("ReplicatedStorage") | |
| local RunService = game:GetService("RunService") | |
| local Animator = require(ReplicatedStorage:WaitForChild("Animator")) | |
| local Figure = script.Parent | |
| local Humanoid = Figure:WaitForChild("Humanoid") | |
| local Rig = Animator.new(Figure) | |
| local Walk = Animator.loadAnimation(require(ReplicatedStorage.animations.Walk)) |
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 | |
| export type Lexer = { | |
| expect: (what: string) -> boolean, | |
| eof: () -> boolean, | |
| requires: (what: string) -> (), | |
| peek: (offset: number?) -> string, | |
| consume: () -> string, | |
| } |
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
| local CurrentCamera = assert(workspace.CurrentCamera) | |
| local ContextActionService = game:GetService("ContextActionService") | |
| local UserInputService = game:GetService("UserInputService") | |
| local RunService = game:GetService("RunService") | |
| local Players = game:GetService("Players") | |
| local beginDragging = require("./beginDragging") |
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
| #ifndef PRIORITY_QUEUE_H | |
| #define PRIORITY_QUEUE_H | |
| #define swap(a, b) do { \ | |
| uint32_t temp = (a); \ | |
| (a) = (b); \ | |
| (b) = temp; \ | |
| } while (0) | |
| #include <stdint.h> |
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
| #ifndef HASHTABLE_H | |
| #define HASHTABLE_H | |
| #include <stdlib.h> | |
| #include <stdint.h> | |
| #define swap(a, b) do { \ | |
| uint32_t temp = (a); \ | |
| (a) = (b); \ | |
| (b) = temp; \ |
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 | |
| -- Matrices are in row-major order | |
| -- magicoal_nerb :3 | |
| local function entry(a: number, b: number, n: number): number | |
| return (a-1)*n + b | |
| end | |
| local function forwardSubstitution(L: { number }, b: { number }): { number } | |
| -- Let A = LU. Ax = b <=> LUx = b |
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 | |
| -- deque; could be used as an object pool | |
| -- magicoal_nerb :3 | |
| local Deque = {} | |
| export type Deque<T> = { | |
| elements: { T }, | |
| capacity: 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
| --!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 |
NewerOlder