Advertisement
antonsavov

Untitled

Mar 6th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. --test reading nad writing the buildzones grid to a file
  2. --creates a grid of absolute references (0,0) (1,0)
  3. function buildGrid(w,h)
  4. local grid = {}
  5. for x=0,w-1 do
  6. for z=0,h-1 do
  7. table.insert(grid,{x=x,z=z,played=false})
  8. end
  9. end
  10. return grid
  11. end
  12.  
  13. LOCS = buildGrid(11,27)
  14.  
  15. fs.makeDir("/records")
  16.  
  17. local file = fs.open("/records/_buildzones-list.yaml","w")
  18. file.write(json.encodePretty(LOCS))
  19. file.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement