This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s = "ab[cd]ef" | |
expected = ['a', 'b', ['c', 'd' ], 'e', 'f'] | |
def parse(xs) | |
result = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<string.h> | |
#define s_plen(STR) STR,strlen(STR) | |
#define test_the(p, len) test_xxx((p), (len),s_plen("the")) | |
#define test_that(p, len) test_xxx((p), (len), s_plen("that")) | |
#define test_this(p, len) test_xxx((p), (len), s_plen("this")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def shortest(*rs): | |
i = 0; | |
while True: | |
for r in rs: | |
try: | |
x = r[i] | |
except IndexError: | |
return r | |
i += 1 | |
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
def _each(f, xs): | |
x = xs[0] | |
f(x) | |
if xs[1:]: | |
_each(f, xs[1:]) | |
def _shortest(i, *rs): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[nori@akagi]~/Desktop/work/cloft/cloft% git diff | |
diff --git a/src/cloft/core.clj b/src/cloft/core.clj | |
index 34ccb7a..80c2fd5 100644 | |
--- a/src/cloft/core.clj | |
+++ b/src/cloft/core.clj | |
@@ -20,6 +20,7 @@ | |
(:import [org.bukkit.potion Potion PotionEffect PotionEffectType]) | |
(:import [org.bukkit.inventory ItemStack])) | |
+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn make-arrow-skill-updater [skill-name] | |
(defn updater [player] | |
(c/broadcast (.getDisplayName player) " changed arrow-skill to " (last skill-name)) | |
(swap! arrow-skill assoc (.getDisplayName player) (first skill-name)) | |
)) | |
(defn skillchange [player block block-against] | |
(when (and | |
(every? identity (map | |
#(= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[nori@akagi]~/Desktop/work/cloft/cloft% git diff ujm | |
diff --git a/src/cloft/core.clj b/src/cloft/core.clj | |
index 6bea28c..a7aec90 100644 | |
--- a/src/cloft/core.clj | |
+++ b/src/cloft/core.clj | |
@@ -362,10 +362,22 @@ | |
; (.setType newblock (.getType block))))))))) | |
; | |
+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nori@akagi]~/Desktop/work/cloft/cloft% git diff | |
diff --git a/src/cloft/core.clj b/src/cloft/core.clj | |
index 6bea28c..9565b1b 100644 | |
--- a/src/cloft/core.clj | |
+++ b/src/cloft/core.clj | |
@@ -362,6 +362,21 @@ | |
; (.setType newblock (.getType block))))))))) | |
; | |
+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn fusion-wall [player] | |
(let [world (.getWorld player) | |
loc (.getLocation player) | |
direction (.normalize (.setY (.getDirection loc) 0)) | |
perpendicular (.normalize ( .setZ (.setY (.setX direction ;fixme | |
(.getZ direction) | |
) | |
0.0 ) | |
(* -1 (.getX direction)) | |
)) |