Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- maxChange = 2
- mon = peripheral.wrap("right")
- x, y = mon.getSize()
- ceny = y / 2
- height = ceny
- function draw(coll)
- mon.setCursorPos(coll, height)
- for i = height, y do
- mon.setCursorPos(coll, i)
- mon.write(" ")
- end
- sleep()
- end
- function perlin()
- step = 0
- repeat
- rand = math.random()
- sleep()
- if rand > 0.8 then
- randup = math.random(maxChange)
- --if randup < 1.9999 then
- up = 1
- --else
- --up = 2
- --end
- height = height + up
- draw(step)
- elseif rand < 0.2 then
- randdown = math.random(maxChange)
- --if randdown < 1.9999 then
- down = 1
- --else
- -- down = 2
- --end
- height = height - down
- draw(step)
- else
- draw(step)
- end
- step = step + 1
- until step == legnth
- end
- while true do
- legnth = x
- height = ceny
- perlin()
- mon.setBackgroundColor(colors.black)
- mon.clear()
- mon.setBackgroundColor(colors.white)
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement