freeman42x

Results 94 comments of freeman42x

If I use: ``` (dotimes [n 1000] (let [enemy (.findNearestEnemy this)] (.say this "Is there an enemy?") (if enemy (.say this "An enemy spotted!") (.moveXY this 40 34)))) ``` it...

I used a function definition to get past the scoping issue: ``` (defn attack [enemy] (if (< (.distanceTo this enemy) 5) (.attack this enemy) (.shield this))) (dotimes [n 1000] (let...

Same issue in `if`s: ``` (dotimes [n 1000] (def enemy (.findNearestEnemy this)) (if enemy (if (< (.distanceTo this enemy) 5) (.say this "message") (if (.isReady this "cleave") (.cleave this enemy)...

Another scoping oddity, this works: ``` (let [x this] (dotimes [n 1000] (def enemy (.findNearestEnemy x)) (.say x (str enemy)) (if enemy (if (< (.distanceTo x enemy) 5) (if (.isReady...

Just wanted to mention that case is not implemented either.

How can you use `when` instead of `cond` or `case`? ``` (defn go [direction] (if (= direction :left) "moving left" (if (= direction :right) "moving right" (if (= direction :up)...

Actually, it should not be possible to use `when` to do that as it only has a true case.

``` (defn go [direction n] (dotimes [_ n] (if (= direction :up) (.moveUp this) (if (= direction :down) (.moveDown this) (if (= direction :right) (.moveRight this) (if (= direction :left)...

I know for sure that multiple key bindings for Haskell files are affected by agda-mode and not just Ctrl+c, Ctrl+l. When agda-mode is enabled Ctrl+C no longer works, and there...

With agda-mode disabled: ![](https://i.imgur.com/hzIKhhr.png) With agda-mode enabled: ![](https://i.imgur.com/Puzfo7q.png)