Skip to content

Instantly share code, notes, and snippets.

@echosa
Created March 12, 2014 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save echosa/9508942 to your computer and use it in GitHub Desktop.
Save echosa/9508942 to your computer and use it in GitHub Desktop.
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