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
function type_out(str) | |
for char in string.gmatch(str, '.') do | |
os.execute("sleep " .. tonumber(0.1)) | |
io.write(char) | |
io.flush() | |
end | |
end | |
-- You can now use `type_out("your string here")!` |
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 n = io.read("*n") | |
repeat | |
if n % 2 == 0 then | |
n = n / 2 | |
print(math.floor(n)) | |
else | |
n = n * 3 + 1 | |
print(math.floor(n)) | |
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
fn integer_limit(bits: i128) -> i128 { | |
( 1 << bits ) - 1 | |
} |