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
-- By xDeltaXen from https://devforum.roblox.com/t/binary-conversion-in-lua/1718171 | |
-- This function takes in a number and returns its binary form as a string | |
function toBinary(num) | |
local bin = "" -- Create an empty string to store the binary form | |
local rem -- Declare a variable to store the remainder | |
-- This loop iterates over the number, dividing it by 2 and storing the remainder each time | |
-- It stops when the number has been divided down to 0 | |
while num > 0 do |