wisp
 
(Arne Babenhauserheide)
2013-08-16: minimum d6 system

minimum d6 system

diff --git a/d6.w b/d6.w
new file mode 100755
--- /dev/null
+++ b/d6.w
@@ -0,0 +1,21 @@
+#!/home/arne/wisp/wisp-multiline.sh 
+; !#
+
+; basic d6 rules, implemented in guile
+
+define : roll
+    let : : die '(-5 -3 -1 2 4 6)
+        list-ref die : random 6 : random-state-from-platform
+
+define : check skill target effect-threshold
+    . "Check whether a given skill-roll succeeds and provide a margin of success."
+    let : : result : + skill : roll
+        if : > result target
+            if : < effect-threshold : - result target
+                . 1
+                . #t
+            . #f
+
+display : check 12 9 3
+newline
+display : roll