From 3c97c01b6257a37a0858584af4509dbd228cf935 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Fri, 14 Jun 2019 11:28:49 -0700 Subject: [PATCH] adjust txtadv --- .../txtadv-demo/demo-short.rkt | 38 +++++++++++++++++++ beautiful-racket-demo/txtadv-demo/main.rkt | 5 +++ beautiful-racket-demo/txtadv-demo/parser.rkt | 2 +- 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 beautiful-racket-demo/txtadv-demo/demo-short.rkt create mode 100644 beautiful-racket-demo/txtadv-demo/main.rkt diff --git a/beautiful-racket-demo/txtadv-demo/demo-short.rkt b/beautiful-racket-demo/txtadv-demo/demo-short.rkt new file mode 100644 index 0000000..a2fb43b --- /dev/null +++ b/beautiful-racket-demo/txtadv-demo/demo-short.rkt @@ -0,0 +1,38 @@ +#lang txtadv-demo + +===VERBS=== + +north, n + "go north" + +south, s + "go south" + +get _, grab _, take _ + "take" + +===THINGS=== + +---cactus--- +get + "You win!" + +===PLACES=== + +---meadow--- +"Welcome to the Cactus Game! You're standing in a meadow. There is a desert to the south." +[] + +south + desert + +---desert--- +"You're in a desert. There is nothing for miles around." +[cactus] + +north + meadow + +===START=== + +meadow \ No newline at end of file diff --git a/beautiful-racket-demo/txtadv-demo/main.rkt b/beautiful-racket-demo/txtadv-demo/main.rkt new file mode 100644 index 0000000..07bd170 --- /dev/null +++ b/beautiful-racket-demo/txtadv-demo/main.rkt @@ -0,0 +1,5 @@ +#lang racket/base + +(module reader racket/base + (require "reader.rkt") + (provide (all-from-out "reader.rkt"))) \ No newline at end of file diff --git a/beautiful-racket-demo/txtadv-demo/parser.rkt b/beautiful-racket-demo/txtadv-demo/parser.rkt index 2e98fdc..d3dc406 100644 --- a/beautiful-racket-demo/txtadv-demo/parser.rkt +++ b/beautiful-racket-demo/txtadv-demo/parser.rkt @@ -1,6 +1,6 @@ #lang brag -txtadv-program : verb-section everywhere-section things-section places-section start-section +txtadv-program : [verb-section] [everywhere-section] [things-section] [places-section] start-section verb-section : /"===VERBS===" verb-item+