We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6c3d942 commit afa650bCopy full SHA for afa650b
strats/simple.clj
@@ -28,10 +28,10 @@
28
(def LM 5)
29
(def GHOST 6)
30
31
-(def at [world-map x y]
+(defn at [world-map x y]
32
(nth (nth (world-map) y) x))
33
34
-(def neighbour [pos direction]
+(defn neighbour [pos direction]
35
(let [x (head pos)
36
y (tail pos)]
37
(if (== direction UP)
strats/stdlib.clj
@@ -1,2 +1,8 @@
1
(defn nth [list pos]
2
- (if (== pos 0) (head list) (nth (tail list) (- pos 1)))
+ (if (== pos 0) (head list) (nth (tail list) (pred pos)))
3
+
4
+(defn succ [x]
5
+ (add x 1))
6
7
+(defn pred [x]
8
+ (sub x 1))
0 commit comments