diff options
| -rw-r--r-- | worms.lua | 24 |
1 files changed, 23 insertions, 1 deletions
@@ -1,4 +1,26 @@ +local NFRUITS = 10 +local NWORMS = 20 + + local M = peripheral.find"monitor" local W,H = M.getSize() -print(W,H) +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 |
