Skip to content

Instantly share code, notes, and snippets.

View kwmu4k's full-sized avatar
🍮
(=´∀`)λ(´∀`=)

ki !! kwmu4k

🍮
(=´∀`)λ(´∀`=)
  • i remember when mitski invtended snow just for that video
  • yume nikki
  • 19:43 (UTC +02:00)
View GitHub Profile
@kwmu4k
kwmu4k / integer_limit.rs
Last active June 12, 2023 19:50
Function to calculate the integer limit of n-bit computers!
fn integer_limit(bits: i128) -> i128 {
( 1 << bits ) - 1
}
@kwmu4k
kwmu4k / collatz.lua
Last active April 6, 2023 16:09
Collatz conjecture in Lua
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
@kwmu4k
kwmu4k / typewriter.lua
Last active May 11, 2023 08:24
Typewriter effect in Lua (unix)
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")!`