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 lua_builtin = { | |
-- Lua Functions | |
["assert"] = true; | |
["collectgarbage"] = true; | |
["error"] = true; | |
["getfenv"] = true; | |
["getmetatable"] = true; | |
["ipairs"] = true; | |
["loadstring"] = true; | |
["newproxy"] = true; |
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
var MARKERS = ["X", "O"]; | |
var PLAYER_1_NAME = document.getElementById("player1name"); | |
var PLAYER_2_NAME = document.getElementById("player2name"); | |
var GAME_MESSAGE = document.getElementById("game-message"); | |
var WIN_SOUND = document.getElementById("win-sound"); | |
var ERROR_SOUND = document.getElementById("error-sound"); | |
var WIN_CODES = [7, 56, 73, 84, 146, 273, 292, 448]; | |
var VALUES = [1, 2, 4, 8, 16, 32, 64, 128, 256]; | |
GAME_MESSAGE.innerText = "Please enter names below."; | |
var PlayerTurn = 0; |
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 bit32 = {} | |
local bit = require("bit") | |
for Index, Function in next, bit do | |
bit32[Index] = Function | |
end | |
bit32.rrotate = bit.ror | |
bit32.lrotate = bit.rol |
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
--[[ | |
Lexical scanner for creating a sequence of tokens from Lua source code. | |
This is a heavily modified and Roblox-optimized version of | |
the original Penlight Lexer module: | |
https://github.com/stevedonovan/Penlight | |
Authors: | |
stevedonovan <https://github.com/stevedonovan> ----------------- Original Penlight lexer author | |
ryanjmulder <https://github.com/ryanjmulder> ----------------- Penlight lexer contributer | |
mpeterv <https://github.com/mpeterv> ----------------- Penlight lexer contributer | |
Tieske <https://github.com/Tieske> ----------------- Penlight lexer contributer |
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 DIGITS = 1000 | |
DIGITS = DIGITS + 2 | |
local LENGTH = math.modf(10 * DIGITS / 3) | |
local RUN_AMOUNT = 100 | |
local STRING = "Time to run %s %d times: %.4f seconds" | |
local os_clock = tick or os.clock | |
local function CalculatePi() |
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 extern CFrame.new; | |
using extern CFrame.fromAxisAngle; | |
using extern Vector3.new; | |
using extern Vector3.FromNormalId; | |
using extern Instance.new; | |
using extern error; | |
typedef ArrayOfInstances table<int, RbxInstance>; | |
RbxInstance ChangeHistoryService = game::GetService @ ChangeHistoryService; |
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
--[[ | |
========================================================================== | |
== API == | |
Differences from the original: | |
Using metatables instead of a function returning a table. | |
Added Vector3, Color3, Vector2, and UDim2 support. | |
Deprecated BrickColors. | |
Changed the creation method from BitBuffer.Create to BitBuffer.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
-- Elliptic Curve Cryptography in Computercraft | |
local byteTableMT = { | |
__tostring = function(a) return string.char(unpack(a)) end, | |
__index = { | |
toHex = function(self, s) return ("%02x"):rep(#self):format(unpack(self)) end, | |
isEqual = function(self, t) | |
if type(t) ~= "table" then return false end | |
if #self ~= #t then return false end | |
local ret = 0 |
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
------------------------------------------------------------------------------------------------------------------ | |
-- CFrameSerializer.lua | |
-- Written by CloneTrooper1019 | |
-- @ 3/7/2019 | |
------------------------------------------------------------------------------------------------------------------ | |
-- Usage | |
-- string CFrameSerializer:EncodeCFrame(CFrame cf) < Compresses a CFrame into a JSON string. | |
-- CFrame CFrameSerializer:DecodeCFrame(string cf) < Decompresses a JSON CFrame string. | |
------------------------------------------------------------------------------------------------------------------ | |
-- Utility Functions |
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 Players = game:GetService("Players") | |
-- Load the DataStore stuff | |
local DEFAULT_DATA = { | |
Money = 0; | |
Inventory = { | |
Cat = false; | |
Dog = false; | |
Fish = true; | |
} |