Created
April 9, 2021 17:47
-
-
Save Eiyeron/8bbe7aba1bb319af286711fe01413df8 to your computer and use it in GitHub Desktop.
Bubble Fortune
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
- Bubble Fortune - | |
------------------- | |
O o . . . . | |
O o O O . O | |
. . O . O o O . | |
O . O . . . | |
o o o O o . . o o | |
O . o . | |
O o O . O O . O | |
o . O O o O . | |
o o o o o . o o O | |
o O . O O O o O | |
------------------- |
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
#!/usr/bin/lua | |
local width = 19 | |
local height = 10 | |
local set = " .oO" | |
local str = "" | |
local hypens = string.rep("-", width) | |
print "- Bubble Fortune -" | |
print(hypens) | |
math.randomseed(os.time()) | |
for y = 1,height do | |
while #str < width do | |
local i = math.random(#set) | |
str = str .. set:sub(i,i) .. " " | |
end | |
local line = str:sub(1, width) | |
print(line) | |
str = str:sub(width+1) | |
end | |
print(hypens) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment