import"CoreLibs/graphics"
local gfx<const> = playdate.graphics
local dsp<const> = playdate.display
local spacing<const> = 10
local xCount
local yCount
local x = 0
local y = 0
local invert = falsefunctionsetup()
dsp.setScale(2)
xCount = dsp.getWidth() / spacingyCount = dsp.getHeight() / spacingendsetup()
functionplaydate.update()
ifmath.random() < 0.5 thengfx.drawLine(x, y, x + spacing, y + spacing)
elsegfx.drawLine(x, y + spacing, x + spacing, y)
endx = x + spacingifx > dsp.getWidth() thenx = 0
y = y + spacingify >= dsp.getHeight() theny = 0
invert = notinvertdsp.setInverted(invert)
gfx.clear()
endendend