summaryrefslogtreecommitdiff
path: root/worms.lua
blob: bccf8e41826144829f93261a32258d7f00ac9b10 (plain)
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
local NFRUITS = 10
local NWORMS = 20


local M = peripheral.find"monitor"
local W,H = M.getSize()

local fruits = {}
for i=1,NFRUITS do
	fruits[i] = {math.random(W),math.random(H)}
end


local function draw()
	M.clear()
	for i,f in ipairs(fruits) do
		M.setCursorPos(f[1],f[2])
		M.setBackgroundColor(colors.red)
		M.write" "
	end
end

while true do
	draw()
	os.sleep(0)
end