Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. (ns battleship.logic)
  2.  
  3. (defrecord Cell [x y clicked? ship?])
  4.  
  5. (defn make-grid []
  6. "This initializes an empty grid. The grid is sized 10 x 10. Each cell stores
  7. its coordinates, whether it has been clicked or not and if it contains a ship."
  8. (vec (for [y (range 10)]
  9. (vec (for [x (range 10)]
  10. (->Cell x y false false))))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement