-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathasd.lua
More file actions
47 lines (40 loc) · 1.12 KB
/
asd.lua
File metadata and controls
47 lines (40 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
local person1 = "Amia"
local person2 = "Midnight"
local function calculateLovePercentage()
return math.random(0, 100)
end
local function displayLovePercentage(percentage, monitor)
monitor.clear()
monitor.setCursorPos(1, 1)
monitor.write("Love Percentage between " .. person1 .. " and " .. person2 .. ":")
monitor.setCursorPos(1, 2)
monitor.write(percentage .. "%")
-- Draw a heart shape
local heart = {
" *** *** ",
" ***** ***** ",
"*************",
" *********** ",
" ********* ",
" ******* ",
" ***** ",
" *** ",
" * "
}
local heartStartX = 25
local heartStartY = 2
for i, line in ipairs(heart) do
monitor.setCursorPos(heartStartX, heartStartY + i - 1)
monitor.write(line)
end
end
local monitor = peripheral.find("monitor")
if monitor then
while true do
local lovePercentage = calculateLovePercentage()
displayLovePercentage(lovePercentage, monitor)
sleep(5)
end
else
print("No monitor found. Please connect a monitor.")
end