This file contains hidden or 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
#!/usr/bin/env python3 | |
# Authored by Reid "arrdem" McKenzie, 10/22/2013 | |
# Licenced under the terms of the EPL 1.0 | |
import cortex.stats as stats | |
def attack_perm_generator(weapons, src_model, tgt_model, | |
focus=0, can_boost_hit=True): | |
"""Recursively compute attack options over two models, focus and weapons! |
This file contains hidden or 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
(defmacro recurse [v] | |
(if (= v :left) | |
`(recur ~'l (rest ~'r) (conj ~'res (first ~'r))) | |
`(recur (rest ~'l) ~'r (conj ~'res (first ~'l))))) | |
(defn %merge [l r] | |
(loop [l l | |
r r | |
res []] | |
(if (every? empty? [l r]) |
This file contains hidden or 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 %remove-first [val seq] | |
(loop [h seq | |
t []] | |
(if (empty? h) | |
t | |
(if (= (first h) val) | |
(concat t (rest h)) | |
(recur (rest h) (conj t (first h))))))) | |
(defn qsort [seq] |
This file contains hidden or 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
#CPU Architecture Specification for CS 352H - Fall 2012 | |
- Special Registers | |
- Function Calls | |
- Interrupts | |
- Virtual Mem. | |
- Register Windows | |
- Memory Addressing Modes | |
- Immediate Values | |
##Conventions |
This file contains hidden or 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
(ns alice.core) | |
(defn candy-delta [ivec] | |
(map first | |
(reduce (fn [pr c] | |
(let [[ps pv] (last pr)] | |
(conj pr | |
(cond (empty? pr) [1 c] | |
(= pv c) [ps pv] | |
(< pv c) [(inc ps) c] |
This file contains hidden or 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
Compiling doubletake.java.spec.core | |
Exception in thread "main" java.lang.ClassNotFoundException: doubletake.java.spec.DependTree (core.clj:1) | |
at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:2911) | |
at clojure.lang.Compiler.compile1(Compiler.java:5933) | |
at clojure.lang.Compiler.compile1(Compiler.java:5923) | |
at clojure.lang.Compiler.compile(Compiler.java:5992) | |
at clojure.lang.RT.compile(RT.java:368) | |
at clojure.lang.RT.load(RT.java:407) | |
at clojure.lang.RT.load(RT.java:381) | |
at clojure.core$load$fn__4511.invoke(core.clj:4905) |
NewerOlder