wisp
 
(Arne Babenhauserheide)
2017-01-12: Implement the basic structure for a duel

Implement the basic structure for a duel

diff --git a/examples/ild.w b/examples/duel.w
copy from examples/ild.w
copy to examples/duel.w
--- a/examples/ild.w
+++ b/examples/duel.w
@@ -8,9 +8,34 @@ exec guile -L "$W" --language=wisp -l "$
 
 import : examples enter-three-witches
 
-Enter : Dr. Arne Bab.
+Enter : Galtag Nimbleday
+        Lowlife Pirate
+        choose your answer
 
-Dr. Arne Bab.
-  Hallo Liebste,
-  ,(color 'red) Ich ,(color 'yellow) liebe ,(color 'red) Dich ,(color #f)
-  Dein Arne
+define answers
+  ' 
+    . "How appropriate! You fight like a cow!"
+    . "And I've got a little TIP for you, get the POINT?"
+
+;; TODO: use macro define-interaction
+define : duel me other
+  say-name other 
+  say-words 
+    : 
+      You fight like a Dairy Farmer!
+  say-name ' : choose your answer
+  say-words
+      : ,(string-join answers "\n  ")
+  let
+    : answer : list-ref answers (string->number (format #f "~a" (peek-char)))
+    drain-input (current-input-port)
+    say-name me
+    say-words
+      :
+        ,answer
+    
+
+;; TODO: Turn this into a macro
+duel
+  ' Galtag Nimbleday
+  ' Lowlife Pirate