View difference between Paste ID: Tg9h8UBW and 1JNfiQVm
SHOW: | | - or go back to the newest paste.
1-
function static()
1+
os.loadAPI("static")
2
3
function hole()
4
x,y = term.getSize()
5
middley = y/2
6
middlex = x/2
7-
for i=1,x do
7+
holesize = 1
8-
posx = i
8+
9
term.setCursorPos(middlex - holesize,middley + holesize)
10-
for i=1,y do
10+
11-
posy = i
11+
write("/")
12-
chance = math.random(0,1)
12+
for i=1,holesize do
13-
if chance == 1 then
13+
write("-")
14-
term.setCursorPos(posx,posy)
14+
15-
write("#")
15+
print("\\")
16
17
prog = 0
18
for i=1,holesize do
19
setCursorPos(middlex - holesize, middley + holesize - prog)
20
write("|")
21
for i=1,holesize do
22
write(" ")
23
end
24
write("|")
25-
function slowStatic()
25+
prog = prog + 1
26
end
27-
static()
27+
28-
sleep(0.75)
28+
29
30
term.setCursorPos(middlex - holesize,middley - holesize)
31
write("/")
32-
function fastStatic()
32+
for i=1,holesize do
33
write("-")
34-
static()
34+
35
print("\\")
36
end
37
38
while true do
39
term.clear()
40
static.static()
41
42-
print("slow or fast?")
42+
43-
answer = read()
43+
for i=1,10 do
44
for i=1,20 do
45
hole()
46-
if answer == "slow" then
46+
47-
slowStatic()
47+
48
holesize = holesize + 2
49
sleep(2)
50-
elseif answer == "fast" then
50+
51-
fastStatic()
51+