# ca3c840cc97b921fab9a76f54c0228e0d39e1d072fa898acf704cf3bf4335e2a Elan 2.0.0-alpha4 valid

main
  variable blocks set to createBlockGraphics(white)
  variable x set to 20
  variable y set to 15
  while true
    set blocks[x][y] to red
    call displayBlocks(blocks)
    set blocks[x][y] to black
    variable direction set to randint(0, 3)
    if direction is 0 then
      set x to min([x + 1, 39])
    elif direction is 1 then
      set x to max([x - 1, 0])
    elif direction is 2 then
      set y to min([y + 1, 29])
    elif direction is 3 then
      set y to max([y - 1, 0])
    end if
  end while
end main
