Skip to content
Browse files

hide non-api fns

  • Loading branch information...
1 parent a6f745c commit 1d101579aaa71cb5f4c7188dc258a9520d1510c9 Robert Campbell committed Dec 11, 2011
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/aichallenge/collisions.clj
View
8 src/aichallenge/collisions.clj
@@ -2,7 +2,7 @@
(:use [clojure.set :only (difference)])
(:require [aichallenge.ant :as ant]))
-(defn collisions [moves]
+(defn- collisions [moves]
(reduce (fn [accum move]
(let [next-loc (apply ant/move-ant move)]
(if (accum next-loc)
@@ -11,23 +11,23 @@
{}
moves))
-(defn find-alternative [m ant dirs]
+(defn- find-alternative [m ant dirs]
(let [poss (map (fn [ant dir]
[ant dir (ant/move-ant ant dir)])
(repeat ant)
dirs)]
(first (remove (fn [[_ _ next-move]] (m next-move))
poss))))
-(defn all-alternatives [collisions]
+(defn- all-alternatives [collisions]
(for [collision collisions
:let [moves (val collision)]
:when (> (count moves) 1)
[ant dir] moves]
(find-alternative collisions ant (difference directions #{dir}))))
(let [directions #{:north :south :east :west}]
- (defn all-alternatives [collisions]
+ (defn- all-alternatives [collisions]
(for [collision collisions
:let [moves (val collision)]
:when (> (count moves) 1)

0 comments on commit 1d10157

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