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
(comment | |
Features: | |
- One monster type: Zombies! | |
- Teleporters | |
- Artificial Unintelligence technology for realistic zombie horde | |
behavior | |
- Full in-game documentation | |
- Trees | |
- Gold (because really, what's a roguelike without gold?) | |
- Each game is guaranteed to end in death by zombie |
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 listify [orig-list] | |
"Turns (1 2 3 ...) into (1 (2 (3 (...)))) using continuation passing style." | |
(loop [lst orig-list cont identity] | |
(if (= () lst) | |
(cont ()) | |
(recur (rest lst) | |
(fn [insert] | |
(cont (cons (first lst) | |
(list insert)))))))) |
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
; Copyright (c) Rich Hickey. All rights reserved. | |
; The use and distribution terms for this software are covered by the | |
; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) | |
; which can be found in the file epl-v10.html at the root of this distribution. | |
; By using this software in any fashion, you are agreeing to be bound by | |
; the terms of this license. | |
; You must not remove this notice, or any other, from this software. | |
(set! *warn-on-reflection* true) |
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
(ns com.wangdera.slideshow | |
(:use [clojure.contrib.test-is]) | |
(:import (java.io File) | |
(javax.imageio ImageIO) | |
(javax.swing JFrame JPanel Timer) | |
(java.awt Dimension Frame Color) | |
(java.awt.event ActionListener WindowAdapter))) | |
(def imagelist (atom [])) | |
(def current-image (atom nil)) |
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 scala.xml.{Node, Elem, Group} | |
/** | |
* A path to a Node in a Node tree. | |
*/ | |
sealed trait NodePath { | |
def depth: Int | |
} | |
object NodePath { |
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
(ns joc | |
(:use [clojure.test])) | |
(defn rpn-orig | |
([tokens] (rpn-orig tokens [])) | |
([[top & tail] stack] | |
(lazy-seq | |
(if top | |
(if (fn? top) | |
(let [l (peek stack) |
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
;; stolen from http://cemerick.com/2010/08/02/defrecord-slot-defaults/ | |
(defmacro defrecord+defaults | |
"Defines a new record, along with a new-RecordName factory function that | |
returns an instance of the record initialized with the default values | |
provided as part of the record's slot declarations. e.g. | |
(defrecord+ Foo [a 5 b \"hi\"]) | |
(new-Foo) | |
=> #user.Foo{:a 5, :b \"hi\"}" | |
[name slots & etc] |
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 "stdlib.h" | |
#include "string.h" | |
typedef char C;typedef long I; | |
typedef struct a{I t,r,d[3],p[2];}*A; | |
#define P printf | |
#define R return | |
#define V1(f) A f(w)A w; | |
#define V2(f) A f(a,w)A a,w; |
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
; Copyright (c) Rich Hickey. All rights reserved. | |
; The use and distribution terms for this software are covered by the | |
; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) | |
; which can be found in the file epl-v10.html at the root of this distribution. | |
; By using this software in any fashion, you are agreeing to be bound by | |
; the terms of this license. | |
; You must not remove this notice, or any other, from this software. | |
; modified by Chris Houser | |
(require '[clojure.contrib.reflect :as hack]) |
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 mundane-pack | |
"Mundane recursive way to pack a sequence" | |
[[f & r :as S]] | |
(if (seq S) | |
(let [[packed tail] (split-with {f true} S)] | |
(if (seq tail) | |
(cons packed (mundane-pack tail)) | |
[packed])) | |
[nil])) |
OlderNewer