Skip to content

Instantly share code, notes, and snippets.

View selfsame's full-sized avatar

Joseph Parker selfsame

View GitHub Profile
@selfsame
selfsame / river.rkt
Created July 29, 2015 17:43
boabab syntax scribble
(def-str form "")
(scene river-bank
(title "Your birthplace on the river")
(initial-desc
"Wetness and cold.
The sweet taste of mud fills your nose and coats your teeth.
You are a:")
(link "forbidden hybrid of human and toad"
(set! form "half-toad")
(ns warmup.core
(:require arcadia.core)
(:use
hard.core
hard.input
tween.core
hard.edit
hard.dispatch)
(:import [UnityEngine Vector3]))
;predicate maker
(defn name-is? [s] (fn [x] (if-let [go (->go x)] (= (.name go) s) false)))
(defn mat-tint [go color]
((tween.core/material-color color 0.2 :pow2) go))
(rule collide-with [a b] {}
(mat-tint a (color 1 1 1)))
(declare look)
(def test-item
{:noun "chest" :material "wooden"
:closed false
:container
[{:noun "spoon" :material "tin"}
{:noun "bag" :material "leather"
:closed true
(ns pred.menu
(:require
hard.life
[tween.core :as tween])
(:use
hard.core
hard.dispatch))
(defn tint> [o color] ((tween.core/material-color color 0.5 :pow2) (->go o)))
[
{"keys": ["alt+."], "command": "insert_snippet", "args": { "contents": "(->${0:v3} ${TM_SELECTED_TEXT})"}},
{"keys": ["ctrl+alt+p"], "command": "repl_restart"},
{ "keys": ["ctrl+alt+enter"], "command": "repl_transfer_current", "args": {"scope": "selection"}},
{ "keys": ["ctrl+enter"], "command": "repl_transfer_current", "args": {"scope": "block"}},
{"keys": ["ctrl+right"],
"command": "paredit_forward_slurp_sexp",
"context": [{"key": "should_paredit"}] },
diff --git a/Compiled.meta b/Compiled.meta
index ccc917b..98aff41 100644
--- a/Compiled.meta
+++ b/Compiled.meta
@@ -1,7 +1,7 @@
fileFormatVersion: 2
-guid: 75d871e7479da41c398891146382ca0a
+guid: 7f7f4d2cda378464989cd93af148f6db
folderAsset: yes
-timeCreated: 1429620904
@sender("arcadia")
def arcadia_sender(repl, text, view):
# call (load-string) instead of just writing the string so
# that syntax errors are caught and thrown back immediately
text = '(load-string "' + text.strip().replace('"', r'\"') + '")'
# find the first non-commented statement from the start of the file
namespacedecl = view.find(r"^[^;]*?\(", 0)
# if it's a namespace declaration, go search for the namespace name
(rule interact [a ad b bd] :default-interaction)
(rule interact [a ^:hp ad b ^:hp bd] :attack-interaction)
(rule interact [a ^:player ad b ^:item bd] :player-item-interaction)
(rule bump-enter [c collision _]
(let [a (->go c)
b (.collider collision)]
(when (and (data a) (data b))
(ns pred.core
(:use pred.dispatch))
(defprotocol IMatrix
(-display [m])
(-specialize [m])
(-score [m])
(-subcol [m s e]))
(deftype Pred [f quote code _meta]