Last active
August 10, 2019 19:37
-
-
Save tvirolai/08cb7e3b87e65dbfb91049f72ebe03a1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns battleship.logic) | |
(defrecord Cell [x y clicked? ship?]) | |
(defn make-grid [] | |
"This initializes an empty grid. The grid is sized 10 x 10. Each cell stores | |
its coordinates, whether it has been clicked or not and if it contains a ship." | |
(vec (for [y (range 10)] | |
(vec (for [x (range 10)] | |
(->Cell x y false false)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment