Natural script writing with Guile The newest step on my path towards - - PowerPoint PPT Presentation

natural script writing with guile
SMART_READER_LITE
LIVE PREVIEW

Natural script writing with Guile The newest step on my path towards - - PowerPoint PPT Presentation

Introduction Prior Art Examples Appendix Natural script writing with Guile The newest step on my path towards the perfect script writing syntax Arne Babenhauserheide February 4, 2017 Arne Babenhauserheide Natural script writing with Guile


slide-1
SLIDE 1

Introduction Prior Art Examples Appendix

Natural script writing with Guile

The newest step on my path towards the perfect script writing syntax Arne Babenhauserheide February 4, 2017

Arne Babenhauserheide Natural script writing with Guile

slide-2
SLIDE 2

Introduction Prior Art Examples Appendix

Hello

Enter : The Audience The Presenter Arne Babenhauserheide Arne Babenhauserheide :imaginary: Sorry for not being here in person. My deepest gratitude to the presenter! The Presenter Hello ,(read-line) .. The Audience (Applause!) ; :)

Arne Babenhauserheide Natural script writing with Guile

slide-3
SLIDE 3

Introduction Prior Art Examples Appendix

Hello (output)

Arne Babenhauserheide Natural script writing with Guile

slide-4
SLIDE 4

Introduction Prior Art Examples Appendix

Scheme-Warning

This is actual Guile code, parsed to Scheme at read time. (import (language wisp spec)) For more information, see draketo.de/english/wisp

Arne Babenhauserheide Natural script writing with Guile

slide-5
SLIDE 5

Introduction Prior Art Examples Appendix

Prior Art

Where we start from. @Presenter: Just for impression. Best give these slides 15s each.

Arne Babenhauserheide Natural script writing with Guile

slide-6
SLIDE 6

Introduction Prior Art Examples Appendix

WML: from Battle for Wesnoth

name=start [message] speaker=MyLeader message= _ "I see the orcs!" [/message] [message] speaker=EnemyLeader message= _ "Grrrr!" [/message] wiki.wesnoth.org/WML_for_Complete_Beginners Verbose, but dialogs are not its main purpose.

Arne Babenhauserheide Natural script writing with Guile

slide-7
SLIDE 7

Introduction Prior Art Examples Appendix

SCUMM: from Monkey Island

cut-scene { ... actor nurse-edna in-room edna-bedroom at 60,20 camera-follow nurse-edna actor nurse-edna walk-to 30,20 wait-for-actor nurse-edna say-line nurse-edna "WHATS’S YOUR POINT ED!!!" wait-for-talking nurse-edna ... } en.wikipedia.org/wiki/SCUMM Not bad, but something is odd (personal impression).

Arne Babenhauserheide Natural script writing with Guile

slide-8
SLIDE 8

Introduction Prior Art Examples Appendix

Python: My last try

from rpg_lib.textrpg import * name = ask("What’s your name?") char2 = Char(source="tag:1w6.org,2008:Nasfar") char1 = Char(source="tag:1w6.org,2008:" + name) story("""A hero is born to save us. """) char2.say("""I only know I want to live. """) char1.say("""You’re a wimp! """) All these quotes, no action between words.

Arne Babenhauserheide Natural script writing with Guile

slide-9
SLIDE 9

Introduction Prior Art Examples Appendix

Spels with Lisp: from Casting Spels with Emacs

(setq map ’((living-room (you are in the living room of a wizards house - there is a wizard snoring loudly on the couch -) (west door garden)))) (defun describe-location (location map) (second (assoc location map))) (describe-location ’living-room map) lisperati.com/casting-spels-emacs/html/casting-spels-emacs-1.html

Close, so close.

Arne Babenhauserheide Natural script writing with Guile

slide-10
SLIDE 10

Introduction Prior Art Examples Appendix

Examples

Where I am.

Arne Babenhauserheide Natural script writing with Guile

slide-11
SLIDE 11

Introduction Prior Art Examples Appendix

Enter three witches (with inline-code)

Enter : First Witch Second Witch First Witch When shall we three meet again In ,(color ’cyan) thunder, ,(color ’white) . lightning, ,(color #f) or in ,(color ’blue) . rain? ,(color #f) Second Witch :resolute When the hurlyburly’s done, (we ,(+ 1 2)) ; ... inline-code is executed when it is displayed

Arne Babenhauserheide Natural script writing with Guile

slide-12
SLIDE 12

Introduction Prior Art Examples Appendix

Enter three witches (with inline-code, output)

Arne Babenhauserheide Natural script writing with Guile

slide-13
SLIDE 13

Introduction Prior Art Examples Appendix

Duel

Enter : Galtag Nimbleday Lowlife Pirate choose your answer define answers ‘ : You fight like a Dairy Farmer! How appropriate! You fight like a cow! And I’ve got a little TIP for you, get the POINT? ; ... (define (Duel ...) ...) for interaction Duel Galtag Nimbleday Lowlife Pirate

Arne Babenhauserheide Natural script writing with Guile

slide-14
SLIDE 14

Introduction Prior Art Examples Appendix

Duel (output)

Arne Babenhauserheide Natural script writing with Guile

slide-15
SLIDE 15

Introduction Prior Art Examples Appendix

Summary

It works. I’m happy ¨ ⌣ Next step: Making Games. Main complication: Shipping Games made with Guile. Find the code in the org-mode source and in the wisp-repo: http://bitbucket.org/ArneBab/wisp/

Arne Babenhauserheide Natural script writing with Guile

slide-16
SLIDE 16

Introduction Prior Art Examples Appendix

Thank you!

¨ ⌣

Arne Babenhauserheide Natural script writing with Guile

slide-17
SLIDE 17

Three Witches (basic)

Enter : First Witch Second Witch Third Witch First Witch When shall we three meet again In thunder, lightning, or in rain? Second Witch :resolute When the hurlyburly’s done, When the battle’s lost and won. Third Witch That will be ere the set of sun.

Arne Babenhauserheide Natural script writing with Guile

slide-18
SLIDE 18

Three witches (basic, output)

Arne Babenhauserheide Natural script writing with Guile

slide-19
SLIDE 19

Prep

#!/usr/bin/env bash # guile-2.0 ~/wisp/wisp.scm ~/wisp/examples/enter-three-witches.w guile-2.0 ~/wisp/examples/enter-three-witches.scm exec guile-2.0 -L ~/wisp --language=wisp -s "$0" "$@" ; !# import : examples enter-three-witches ice-9 rdelim

Arne Babenhauserheide Natural script writing with Guile