File: dungeon.mpw

package info (click to toggle)
mathpiper 0.81f%2Bsvn4469%2Bdfsg3-4
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 36,576 kB
  • sloc: java: 57,479; lisp: 13,721; objc: 1,300; xml: 988; makefile: 114; awk: 95; sh: 38
file content (77 lines) | stat: -rw-r--r-- 1,341 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
%mathpiper,title=""





//Kitchen.
kitchen := {};
kitchen["name"] := "kitchen";
kitchen["description"] :=
"
You are in a bright white room which has a sink on its
east wall which has cupboards above and below it. A table
with 4 chairs is in the center of the room and a refridgerator is
in its north west corner. Sitting on the table is 
a piece of paper with writing on it.

There is an exit to the north.

";


//Dining room.
diningRoom := {};
diningRoom["name"] := "dining room";
diningRoom["description"] := 
"
You are in a large rectangular room with a high ceiling.
There is an oak table in the center of the room with 12 
chairs around it.  There is a crystal chandelier above
the table. 

There is an exit to the south.

";




//Connect the rooms together.
kitchen["n"] := diningRoom;
diningRoom["s"] := kitchen;



%/mathpiper

    %output,preserve="false"
      Result: True
.   %/output


%mathpiper


currentRoom := diningRoom;

While( True )
[
    
    userInput := AskUser(currentRoom["description"] : Nl(): "Which direction (n,s,e,w,ne,se,sw,nw,q to quit)?");
    
    
    If(userInput = "q", Break());

    
    If(currentRoom[userInput] != Empty, currentRoom := currentRoom[userInput], TellUser("There is no exit in that direction."));
    
];

%/mathpiper

    %output,preserve="false"
      Result: True
.   %/output