Skip to content
Browse files

Various minor fixes to a couple of instructions

  • Loading branch information...
1 parent c146fa7 commit 88b27e671841b743838ce07ce47e69f885481ccb @palfrey committed Jul 5, 2012
Showing with 12 additions and 10 deletions.
  1. +12 −10 src/clostridium/core.clj
View
22 src/clostridium/core.clj
@@ -207,7 +207,7 @@
)
(defn rotateCCW [b] (assoc b :dir (let [[x y] (:dir b)] [(* y -1) x])))
-(defn rotateCW [b] (assoc b :dir (let [[x y] (:dir b)] [y (* x -1)])))
+(defn rotateCW [b] (assoc b :dir (let [[x y] (:dir b)] [y (* x -1)])))
(defn runInst [b inst]
(let [
@@ -326,18 +326,20 @@
\f (fn [b] (addToStack b 15))
\[ rotateCW
\] rotateCCW
- \' (fn [nb] (let [b (updatePC nb true)]
- (updatePC (addToStack b (int (current b))))
- ))
+ \' (fn [nb]
+ (let [b (updatePC nb true)]
+ (addToStack b (int (current b)))
+ )
+ )
\w (fn [nb]
(let [
{:keys [b items]} (removeManyFromStack nb 2)
[one two] items
]
- (if (> one two)
- (rotateCW b)
- (if (< one two)
- (rotateCCW b)
+ (if (< one two)
+ (rotateCCW b)
+ (if (> one two)
+ (rotateCW b)
b
)
)
@@ -349,8 +351,8 @@
[x y] items
]
(do
- (println "Absolute delta " x " " y " " (:pc b) (:dir b))
- (assoc b :dir [x y])
+ (println "Absolute delta:" x y (:pc b) (:dir b))
+ (assoc b :dir [y x])
)
)
)

0 comments on commit 88b27e6

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