Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

mapcat instead of (apply (concat (map ...

  • Loading branch information...
commit 78e1e411132f0d1cb1639ffdd4be368fe0b8fb7f 1 parent 290cfa7
@reiddraper authored
Showing with 5 additions and 7 deletions.
  1. +5 −7 src/crosscram/core.clj
View
12 src/crosscram/core.clj
@@ -32,14 +32,12 @@
[[x column] [(+ 1 x) column]])))
(defn generate-horizontal [rows columns]
- (apply concat
- (map (partial generate-horizontal-for-row columns)
- (range rows))))
+ (mapcat (partial generate-horizontal-for-row columns)
+ (range rows)))
(defn generate-vertical [rows columns]
- (apply concat
- (map (partial generate-vertical-for-column rows)
- (range columns))))
+ (mapcat (partial generate-vertical-for-column rows)
+ (range columns)))
(defn- two-nil? [coll]
(= true (reduce (fn [acc elem]
@@ -102,7 +100,7 @@
;; is someone trying to play on a spot that is already
;; occupied?
(not (location-empty? (:board game) pos-a pos-b)) (throw (Exception.
- "Can't move here, it's occupied"))
+ "Can't move here, it's occupied"))
;; ok, play the piece!
true

1 comment on commit 78e1e41

Please sign in to comment.
Something went wrong with that request. Please try again.