Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
This results in a deprecated warning for fn>. Posting here to link to a Jira ticket.
(ann get-number-of-cleared-spaces
[(IPersistentVector (IPersistentVector Any))
->
AnyInteger])
(defn get-number-of-cleared-spaces
"Returns the number of cleared spaces in the grid."
[grid]
(inc (reduce (fn> [[cleared :- AnyInteger]
[row :- (IPersistentVector Any)]]
(let [result (inc (reduce (fn> [[row-cleared :- AnyInteger]
[grid-item :- Any]]
(if (or (= grid-item 0)
(= grid-item "@"))
(inc row-cleared)
row-cleared))
-1 row))]
(+ cleared result)))
-1 grid)))
;; "DEPRECATED WARNING: fn> syntax has changed, use [b :- t i] for clauses" "ns: " #<Namespace greed.grid>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.