Leo B. Goes Home
broom.vxml
xml version="1.0" encoding="UTF-8"
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml" application="main.vxml">
<meta name="author"
content="Vit Novacek, Faculty of Informatics, Masaryk University Brno,
Czaech Republic"/>
<meta name="copyright"
content="Copyright (c) 2004 Vit Novacek; You can redistribute and/or modify
this file under the terms of the GNU General Public License"/>
<form id="init">
<block>
<if cond="inventory[3]">
<prompt>
You are in a bedroom. It is quiet here. What do you want to do?
</prompt>
<else/>
<prompt>
You are in a bedroom. It is quiet here. On the pillow besides the bed
is snoozing a black cat. What do you want to do?
</prompt>
</if>
</block>
<field name="action">
<noinput> Come on, you need to get home! </noinput>
<nomatch> Try to say something else. </nomatch>
<grammar src="broom.grxml"/>
<grammar src="exit.grxml"/>
</field>
<filled namelist="action">
<if cond="action == 'exit'">
<goto next="#exit"/>
<else/>
<script>
<![CDATA[
var intact=parseInt(action,10);
trigger=process5(intact);
]]>
</script>
<prompt><value expr="prompt"/></prompt>
<if cond="trigger==1">
<goto next="uhall.vxml#init"/>
<else/>
<goto next="#init"/>
</if>
</if>
</filled>
</form>
<form id="exit">
<field name="exit_ask">
<noinput> Hey, don't sleep! </noinput>
<nomatch> Say 'yes' or 'no' </nomatch>
<prompt> Do you really want to stop playing the game? </prompt>
<grammar src="yesno.grxml"/>
<filled>
<if cond="exit_ask=='yes'">
<prompt> Ok, let's go to the initial stage. </prompt>
<goto next="main.vxml#init"/>
<else/>
<prompt>
You've changed your mind? That's good, game continues...
</prompt>
<goto next="#init"/>
</if>
</filled>
</field>
</form>
</vxml>
cellar.vxml
xml version="1.0" encoding="UTF-8"
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml" application="main.vxml">
<meta name="author"
content="Vit Novacek, Faculty of Informatics, Masaryk University Brno,
Czaech Republic"/>
<meta name="copyright"
content="Copyright (c) 2004 Vit Novacek; You can redistribute and/or modify
this file under the terms of the GNU General Public License"/>
<form id="init">
<block>
<if cond="inventory[0]">
<prompt>
You are in the cellar. You see the stairs leading up to the house. Near
the wall stands old rusty washing-machine. What do you want to do?
</prompt>
<else/>
<prompt>
You are in the cellar. You see the stairs leading up to the house.
There is a mouse trap under the stairs. Near the wall stands old rusty
washing-machine. What do you want to do?
</prompt>
</if>
</block>
<field name="action">
<noinput> Come on, you need to get home! </noinput>
<nomatch> Try to say something else. </nomatch>
<grammar src="cellar.grxml"/>
<grammar src="exit.grxml"/>
</field>
<filled namelist="action">
<if cond="action == 'exit'">
<goto next="#exit"/>
<else/>
<script>
<![CDATA[
var intact=parseInt(action,10);
trigger=process0(intact);
]]>
</script>
<prompt><value expr="prompt"/></prompt>
<if cond="trigger==1">
<goto next="lhall.vxml#init"/>
<else/>
<goto next="#init"/>
</if>
</if>
</filled>
</form>
<form id="exit">
<field name="exit_ask">
<noinput> Hey, don't sleep! </noinput>
<nomatch> Say 'yes' or 'no' </nomatch>
<prompt> Do you really want to stop playing the game? </prompt>
<grammar src="yesno.grxml"/>
<filled>
<if cond="exit_ask=='yes'">
<prompt> Ok, let's go to the initial stage. </prompt>
<goto next="main.vxml#init"/>
<else/>
<prompt>
You've changed your mind? That's good, game continues...
</prompt>
<goto next="#init"/>
</if>
</filled>
</field>
</form>
</vxml>
croom.vxml
xml version="1.0" encoding="UTF-8"
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml" application="main.vxml">
<meta name="author"
content="Vit Novacek, Faculty of Informatics, Masaryk University Brno,
Czaech Republic"/>
<meta name="copyright"
content="Copyright (c) 2004 Vit Novacek; You can redistribute and/or modify
this file under the terms of the GNU General Public License"/>
<form id="init">
<block>
<if cond="statueBr">
<prompt>
You are in a funny tawdy children room. The room is quite in a mess. You
see a broken Harry Potter statuette on the floor.
What do you want to do?
</prompt>
<else/>
<prompt>
You are in a funny tawdy children room. On a tall piedestal near the
plastic slide stands a statuette of Harry Potter with a magic wand.
What do you want to do?
</prompt>
</if>
</block>
<field name="action">
<noinput> Come on, you need to get home! </noinput>
<nomatch> Try to say something else. </nomatch>
<grammar src="croom.grxml"/>
<grammar src="exit.grxml"/>
</field>
<filled namelist="action">
<if cond="action == 'exit'">
<goto next="#exit"/>
<else/>
<script>
<![CDATA[
var intact=parseInt(action,10);
trigger=process6(intact);
]]>
</script>
<prompt><value expr="prompt"/></prompt>
<if cond="trigger==1">
<goto next="uhall.vxml#init"/>
<else/>
<goto next="#init"/>
</if>
</if>
</filled>
</form>
<form id="exit">
<field name="exit_ask">
<noinput> Hey, don't sleep! </noinput>
<nomatch> Say 'yes' or 'no' </nomatch>
<prompt> Do you really want to stop playing the game? </prompt>
<grammar src="yesno.grxml"/>
<filled>
<if cond="exit_ask=='yes'">
<prompt> Ok, let's go to the initial stage. </prompt>
<goto next="main.vxml#init"/>
<else/>
<prompt>
You've changed your mind? That's good, game continues...
</prompt>
<goto next="#init"/>
</if>
</filled>
</field>
</form>
</vxml>
kitchen.vxml
xml version="1.0" encoding="UTF-8"
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml" application="main.vxml">
<meta name="author"
content="Vit Novacek, Faculty of Informatics, Masaryk University Brno,
Czaech Republic"/>
<meta name="copyright"
content="Copyright (c) 2004 Vit Novacek; You can redistribute and/or modify
this file under the terms of the GNU General Public License"/>
<form id="init">
<block>
<prompt>
You are in a kitchen. The air is full of smell of gurgling oil and frying
burgers. A corpulent lady is hasting around, paying attention to nothing
but her pans and sweet potatoes. In the wide opened fridge door you see
a very tasty looking cheese. What do you want to do?
</prompt>
</block>
<field name="action">
<noinput> Come on, you need to get home! </noinput>
<nomatch> Try to say something else. </nomatch>
<grammar src="kitchen.grxml"/>
<grammar src="exit.grxml"/>
</field>
<filled namelist="action">
<if cond="action == 'exit'">
<goto next="#exit"/>
<else/>
<script>
<![CDATA[
var intact=parseInt(action,10);
trigger=process3(intact);
]]>
</script>
<prompt><value expr="prompt"/></prompt>
<if cond="trigger==1">
<goto next="lhall.vxml#init"/>
<else/>
<goto next="#init"/>
</if>
</if>
</filled>
</form>
<form id="exit">
<field name="exit_ask">
<noinput> Hey, don't sleep! </noinput>
<nomatch> Say 'yes' or 'no' </nomatch>
<prompt> Do you really want to stop playing the game? </prompt>
<grammar src="yesno.grxml"/>
<filled>
<if cond="exit_ask=='yes'">
<prompt> Ok, let's go to the initial stage. </prompt>
<goto next="main.vxml#init"/>
<else/>
<prompt>
You've changed your mind? That's good, game continues...
</prompt>
<goto next="#init"/>
</if>
</filled>
</field>
</form>
</vxml>
lhall.vxml
xml version="1.0" encoding="UTF-8"
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml" application="main.vxml">
<meta name="author"
content="Vit Novacek, Faculty of Informatics, Masaryk University Brno,
Czaech Republic"/>
<meta name="copyright"
content="Copyright (c) 2004 Vit Novacek; You can redistribute and/or modify
this file under the terms of the GNU General Public License"/>
<form id="init">
<block>
<prompt>
You are in a hall. There are stairs leading up and other stairs,
which are descending to cellar. On the left hand side of the cellar
stairs is passage to the kitchen, on the right hand side you see the
living room door. The hall lookout is dominated by massive entrance
door with a forked green palm standing besides it. What do you want to
do?
</prompt>
</block>
<field name="action">
<noinput> Come on, you need to get home! </noinput>
<nomatch> Try to say something else. </nomatch>
<grammar src="lhall.grxml"/>
<grammar src="exit.grxml"/>
</field>
<filled namelist="action">
<if cond="action == 'exit'">
<goto next="#exit"/>
<else/>
<script>
<![CDATA[
var intact=parseInt(action,10);
trigger=process1(intact);
]]>
</script>
<prompt><value expr="prompt"/></prompt>
<if cond="trigger==1">
<goto next="uhall.vxml#init"/>
<elseif cond="trigger==2"/>
<goto next="cellar.vxml#init"/>
<elseif cond="trigger==3"/>
<goto next="kitchen.vxml#init"/>
<elseif cond="trigger==4"/>
<goto next="lroom.vxml#init"/>
<else/>
<goto next="#init"/>
</if>
</if>
</filled>
</form>
<form id="exit">
<field name="exit_ask">
<noinput> Hey, don't sleep! </noinput>
<nomatch> Say 'yes' or 'no' </nomatch>
<prompt> Do you really want to stop playing the game? </prompt>
<grammar src="yesno.grxml"/>
<filled>
<if cond="exit_ask=='yes'">
<prompt> Ok, let's go to the initial stage. </prompt>
<goto next="main.vxml#init"/>
<else/>
<prompt>
You've changed your mind? That's good, game continues...
</prompt>
<goto next="#init"/>
</if>
</filled>
</field>
</form>
</vxml>
lroom.vxml
xml version="1.0" encoding="UTF-8"
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml" application="main.vxml">
<meta name="author"
content="Vit Novacek, Faculty of Informatics, Masaryk University Brno,
Czaech Republic"/>
<meta name="copyright"
content="Copyright (c) 2004 Vit Novacek; You can redistribute and/or modify
this file under the terms of the GNU General Public License"/>
<form id="init">
<block>
<prompt>
You're in the living room. There is sitting a man on the sofa. He is
almost asleep while watching TV and drinking beer.
</prompt>
</block>
<field name="action">
<noinput> Come on, you need to get home! </noinput>
<nomatch> Try to say something else. </nomatch>
<grammar src="lroom.grxml"/>
<grammar src="exit.grxml"/>
</field>
<filled namelist="action">
<if cond="action == 'exit'">
<goto next="#exit"/>
<else/>
<script>
<![CDATA[
var intact=parseInt(action,10);
trigger=process4(intact);
]]>
</script>
<prompt><value expr="prompt"/></prompt>
<if cond="trigger==1">
<goto next="lhall.vxml#init"/>
<elseif cond="trigger==2"/>
<audio src="tada.wav"/>
<goto next="main.vxml#init"/>
<else/>
<goto next="#init"/>
</if>
</if>
</filled>
</form>
<form id="exit">
<field name="exit_ask">
<noinput> Hey, don't sleep! </noinput>
<nomatch> Say 'yes' or 'no' </nomatch>
<prompt> Do you really want to stop playing the game? </prompt>
<grammar src="yesno.grxml"/>
<filled>
<if cond="exit_ask=='yes'">
<prompt> Ok, let's go to the initial stage. </prompt>
<goto next="main.vxml#init"/>
<else/>
<prompt>
You've changed your mind? That's good, game continues...
</prompt>
<goto next="#init"/>
</if>
</filled>
</field>
</form>
</vxml>
main.vxml
xml version="1.0" encoding="UTF-8"
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
<meta name="author"
content="Vit Novacek, Faculty of Informatics, Masaryk University Brno,
Czaech Republic"/>
<meta name="copyright"
content="Copyright (c) 2004 Vit Novacek; You can redistribute and/or modify
this file under the terms of the GNU General Public License"/>
<var name="inventory"/>
<var name="tvState"/>
<var name="statueBr"/>
<var name="trigger"/>
<var name="prompt"/>
<script>
<![CDATA[
// initialization of inventory (false ... no such item in inventory)
// 0 ... mouse trap
// 1 ... beer can
// 2 ... cheese
// 3 ... cat
// 4 ... magic wand
// 5 ... trap&cheese
// 6 ... trap&mouse
function initInv() {
for(var i=0; i<7; i++) {
inventory[i]=false;
}
}
// gets the actual inventory string representation
function getInv() {
var inv = new Array("mouse trap, ",
"Guinness beer can, ",
"piece of cheese, ",
"black cat, ",
"magic wand, ",
"mouse trap with cheese bait, ",
"trap with a mouse inside, ");
var str = "Your actual loot consists of: ";
for(var i=0; i<=6; i++) {
if(inventory[i])
str=str+inv[i];
}
return str;
}
// processing the semantics of particular rooms
function process0(act) {
var trg=0, ind, suffind=0;
var suffixes=new Array("","mouse trap.","beer.","cheese.",
"cat.","magic wand.");
var strs=new Array("You're going upstairs.",
"Ordinary mouse trap, there is no bait inside.",
"What a huge hollow useless mechanism. But there is a beer can inside!",
"Wow, a well preserved can of Guinness beer!",
"You took a trap.",
"It's too heavy!",
"You took a beer.",
"Nothing happened.",
"You don't have any ",
"You put the trap with a cheese bait on the floor. Suddenly a mouse ran from the dark corner and got caught in the trap. So now you have a trap with the mouse inside!",
"Something is scrunching inside.",
"What a huge hollow useless mechanism.",
"You put the cheese into the trap!");
switch(act) {
case 10: trg=1; ind=0; break;
case 20: ind=1; break;
case 21: if(inventory[1]) {ind=11; break;} else {ind=2; break;}
case 22: ind=3; break;
case 30: ind=4; inventory[0]=true; break; // trap taken
case 31: ind=5; break; // cannot take washing-m.
case 32: ind=6; inventory[1]=true; break; // beer taken
case 40:
if(inventory[0] || inventory[6]) { // trap empty or mouse already in
ind=7; break;
} else {
if(inventory[5]) { // trap with cheese-catch a mouse
ind=9; inventory[5]=false; inventory[6]=true; break;
} else {
ind=8; suffind=1; // no trap
}
}
break;
case 41:
ind=10; break; // something's scrunching inside
case 42:
if(inventory[1]) {ind=7; break;} else {ind=8; suffind=2; break;}
case 43:
if(inventory[2]) {
if(inventory[0]) {
ind=12; inventory[0]=false; inventory[2]=false;
inventory[5]=true; break;
} else {
ind=7; break;
}
} else {ind=8; suffind=3; break;}
case 44:
if(inventory[3]) {ind=7; break;} else {ind=8; suffind=4; break;}
case 45:
if(inventory[4]) {ind=7; break;} else {ind=8; suffind=5; break;}
}
if(act!=255)
prompt=strs[ind]+suffixes[suffind];
else
prompt=getInv();
return trg;
}
function process1(act) {
var trg=0, ind, suffind=0;
var suffixes=new Array("","mouse trap.","beer.","cheese.",
"cat.","magic wand.");
var strs=new Array("You're going upstairs.",
"You're going to the cellar.",
"You're going to the kitchen.",
"You're going to the living room.",
"I really don't want to get lost out there while admiring an American suburban architecture. I'd rather stay indside the house.",
"A genuine palm with a bunch of thick leafs.",
"It's too heavy!",
"Nothing happened.",
"You don't have any ",
"You've manufactured a fancy disguise headband from the palm leaf. Now you're yet less likely to be seen than before.",
"You put the cheese into the trap!");
switch(act) {
case 10: trg=1; ind=0; break;
case 11: trg=2; ind=1; break;
case 12: trg=3; ind=2; break;
case 13: trg=4; ind=3; break;
case 14: ind=4; break;
case 20: ind=5; break;
case 30: ind=6; break;
case 40:
if(inventory[0] || inventory[5] || inventory[6])
{ind=7; break;}
else
{ind=8; suffind=1; break;}
case 41: ind=9; break;
case 42:
if(inventory[1]) {ind=7; break;} else {ind=8; suffind=2; break;}
case 43:
if(inventory[2]) {
if(inventory[0]) {
ind=10; inventory[0]=false; inventory[2]=false;
inventory[5]=true; break;
} else {
ind=7; break;
}
} else {ind=8; suffind=3; break;}
case 44:
if(inventory[3]) {ind=7; break;} else {ind=8; suffind=4; break;}
case 45:
if(inventory[4]) {ind=7; break;} else {ind=8; suffind=5; break;}
}
if(act!=255)
prompt=strs[ind]+suffixes[suffind];
else
prompt=getInv();
return trg;
}
function process2(act) {
var trg=0, ind, suffind=0;
var suffixes=new Array("","mouse trap.","beer.","cheese.",
"cat.","magic wand.");
var strs=new Array("You're going downstairs.",
"You're going to the bedroom.",
"You're going to the children room.",
"Nothing happened.",
"You don't have any ",
"You put the cheese into the trap!");
switch(act) {
case 10: trg=1; ind=0; break;
case 11: trg=2; ind=1; break;
case 12: trg=3; ind=2; break;
case 40:
if(inventory[0] || inventory[5] || inventory[6])
{ind=3; break;}
else
{ind=4; suffind=1; break;}
case 41:
if(inventory[1]) {ind=3; break;} else {ind=4; suffind=2; break;}
case 42:
if(inventory[2]) {
if(inventory[0]) {
ind=5; inventory[0]=false; inventory[2]=false;
inventory[5]=true; break;
} else {
ind=3; break;
}
} else {ind=4; suffind=3; break;}
case 43:
if(inventory[3]) {ind=3; break;} else {ind=4; suffind=4; break;}
case 44:
if(inventory[4]) {ind=3; break;} else {ind=4; suffind=5; break;}
}
if(act!=255)
prompt=strs[ind]+suffixes[suffind];
else
prompt=getInv();
return trg;
}
function process3(act) {
var trg=0, ind, suffind=0;
var suffixes=new Array("","mouse trap.","beer.","cheese.",
"cat.","magic wand.");
var strs=new Array("You're going back to the lower hall.",
"A nice yellow little piece of cheese.",
"I'd rather stay off this squirling tornado.",
"You took a piece of cheese.",
"Nothing happened.",
"You don't have any ",
"You've tried to spook the lady, but she seems to be too unconcerned with her vicinity, so it takes no effect.",
"You put the cheese into the trap!");
switch(act) {
case 10: trg=1; ind=0; break;
case 20: ind=1; break;
case 21: ind=2; break;
case 30: ind=3; inventory[2]=true; break;
case 40:
if(inventory[0] || inventory[5] || inventory[6])
{ind=4; break;} else {ind=5; suffind=1; break;}
case 41: ind=6; break;
case 42:
if(inventory[1]) {ind=4; break;} else {ind=5; suffind=2; break;}
case 43:
if(inventory[2]) {
if(inventory[0]) {
ind=7; inventory[0]=false; inventory[2]=false;
inventory[5]=true; break;
} else {
ind=4; break;
}
} else {ind=5; suffind=3; break;}
case 44:
if(inventory[3]) {ind=4; break;} else {ind=5; suffind=4; break;}
case 45:
if(inventory[4]) {ind=4; break;} else {ind=5; suffind=5; break;}
}
if(act!=255)
prompt=strs[ind]+suffixes[suffind];
else
prompt=getInv();
return trg;
}
function process4(act) {
var trg=0, ind, suffind=0;
var suffixes=new Array("","mouse trap.","beer.","cheese.",
"cat.","magic wand.");
var strs=new Array("You're going back to the lower hall.",
"A kind of some telecommunication device. Perhaps it could be used as teleport?",
"Bald man drinking beer and watching TV. You're wondering if it is not a Homer Simpson himself.",
"It's too heavy.",
"Nothing happened.",
"You don't have any ",
"You've tried to spook the man, but he just shook his head and murmured something about unpredictable effects of more than two gallons of beer.",
"You put the cheese into the trap!",
"You poured the Guinness beer onto the TV. It is sparkling and scrambling a while. Suddenly the programme is replaced with a view of familiar green Irish meadow! Now you only have to find out how to get through the solid TV screen.",
"You wielded the magic wand in front of the TV. After a second the screen vanishes in a soft flash and the teleport to your sweet country is opened. Now you can finally get off this scary place! Congratulations, Leo B., you're the most inventive leprechaun in the world and surrounding dimensions!");
switch(act) {
case 10: trg=1; ind=0; break;
case 20: ind=1; break;
case 21: ind=2; break;
case 30: ind=3; break;
case 40:
if(inventory[0] || inventory[5] || inventory[6])
{ind=4; break;} else {ind=5; suffind=1; break;}
case 41: ind=6; break;
case 42:
if(inventory[1])
{ind=8; tvState=true; break;}
else
{ind=5; suffind=2; break;}
case 43:
if(inventory[2]) {
if(inventory[0]) {
ind=7; inventory[0]=false; inventory[2]=false;
inventory[5]=true; break;
} else {
ind=4; break;
}
} else {ind=5; suffind=3; break;}
case 44:
if(inventory[3]) {ind=4; break;} else {ind=5; suffind=4; break;}
case 45:
if(inventory[4]) {
if(tvState) {
ind=9; trg=2; break;
} else {ind=4; break;}
} else {ind=5; suffind=5; break;}
}
if(act!=255)
prompt=strs[ind]+suffixes[suffind];
else
prompt=getInv();
return trg;
}
function process5(act) {
var trg=0, ind, suffind=0;
var suffixes=new Array("","mouse trap.","beer.","cheese.",
"cat.","magic wand.");
var strs=new Array("You're going back to the upper hall.",
"A hellish black cat. Must be a real mouse-slayer.",
"You took a cat. It sits happily upon your shoulder now.",
"Nothing happened.",
"You don't have any ",
"You put the cheese into the trap!");
switch(act) {
case 10: trg=1; ind=0; break;
case 20: ind=1; break;
case 30: ind=2; inventory[3]=true; break;
case 40:
if(inventory[0] || inventory[5] || inventory[6])
{ind=3; break;} else {ind=4; suffind=1; break;}
case 41:
if(inventory[1]) {ind=3; break;} else {ind=4; suffind=2; break;}
case 42:
if(inventory[2]) {
if(inventory[0]) {
ind=5; inventory[0]=false; inventory[2]=false;
inventory[5]=true; break;
} else {
ind=3; break;
}
} else {ind=4; suffind=3; break;}
case 43:
if(inventory[3]) {ind=3; break;} else {ind=4; suffind=4; break;}
case 44:
if(inventory[4]) {ind=3; break;} else {ind=4; suffind=5; break;}
}
if(act!=255)
prompt=strs[ind]+suffixes[suffind];
else
prompt=getInv();
return trg;
}
function process6(act) {
var trg=0, ind, suffind=0;
var suffixes=new Array("","mouse trap.","beer.","cheese.",
"cat.","magic wand.");
var strs=new Array("You're going back to the upper hall.",
"A statuette of Harry Potter holding the magic wand, unfortunately it is too high to reach for you.",
"A broken Harry Potter statuette on the floor. It seems to be useless, maybe except Harry's magic wand.",
"A broken Harry Potter statuette on the floor.",
"You cannot reach it!",
"You took the Harry Potter's magic wand.",
"You put the trap with the mouse on the floor. When the cat on your shoulder and mouse saw each other, a little apocalypse begun. Most of the room is destroyed after both of the animals flew off through the window. The Harry Potter's statue is now lieing broken on the floor.",
"Nothing happened.",
"You don't have any ",
"You put the cheese into the trap!");
switch(act) {
case 10: trg=1; ind=0; break;
case 20:
if(!statueBr) {
ind=1; break;
} else {
if(!inventory[4]) ind=2; else ind=3;
break;
}
case 30:
if(!statueBr) {ind=4; break;} else {ind=5; inventory[4]=true; break;}
case 40:
if(inventory[0] || inventory[5] || inventory[6]) {
if(inventory[6] && inventory[3]) {
ind=6; statueBr=true;
inventory[6]=false; inventory[3]=false; break;
} else {
ind=7; break;
}
} else {
ind=8; suffind=1; break;
}
case 41:
if(inventory[1]) {ind=7; break;} else {ind=8; suffind=2; break;}
case 42:
if(inventory[2]) {
if(inventory[0]) {
ind=8; inventory[0]=false; inventory[2]=false;
inventory[5]=true; break;
} else {
ind=7; break;
}
} else {ind=4; suffind=3; break;}
case 43:
if(inventory[3]) {ind=7; break;} else {ind=8; suffind=4; break;}
case 44:
if(inventory[4]) {ind=7; break;} else {ind=8; suffind=5; break;}
}
if(act!=255)
prompt=strs[ind]+suffixes[suffind];
else
prompt=getInv();
return trg;
}
]]>
</script>
<menu id="init" dtmf="true">
<prompt>
Welcome to the game 'Leo B. Goes home'!
What do you want to do now? <enumerate/>
</prompt>
<choice next="#info">
Hear info
</choice>
<choice next="#start">
Start the game
</choice>
<choice next="#quit">
Quit
</choice>
<noinput>
<prompt> What's up? Come on, make a choice from: <enumerate/> </prompt>
</noinput>
<nomatch>
<prompt> Beg your pardon? Try to make a choice from: <enumerate/> </prompt>
</nomatch>
</menu>
<form id="info">
<block>
'Leo B. Goes Home' is a simple adventure game. You are a little leprechaun
called Leo B., who was accidentaly summoned to a typical
American house, which is occupied by a typical American family. The task
of the game is to get off this weird place and transport yourself back to
your comfortable burrow in the middle of beautiful green Irish meadows.
</block>
<field name="answer">
<noinput> Hey, don't sleep! </noinput>
<nomatch> Say 'yes' or 'no'. </nomatch>
<prompt> Do you want to hear it once more? </prompt>
<grammar src="yesno.grxml"/>
<grammar src="exit.grxml"/>
<filled>
<if cond="answer == 'yes'">
<prompt> Ok, I will repeat it. </prompt>
<goto next="#info"/>
<elseif cond="answer == 'no'"/>
<prompt> Ok, let's go back. </prompt>
<goto next="#init"/>
<elseif cond="answer == 'exit'"/>
<goto next="#quit"/>
</if>
</filled>
</field>
</form>
<form id="start">
<block>
<prompt>
Let's start the game!
You appeared in a dark cellar. The last thing you remember is that
you were drinking an invisibility potion from your family wizard Crook
in order to hide before curious tourists on fiddle feast. The old Crook
must have mistaken it. It seems the potion teleported you to some
strange unfamiliar place instead of simply rendering you invisible. Now
you need to find a way back home.
</prompt>
<script>
<![CDATA[
inventory = new Array(7);
initInv();
tvState=false;
statueBr=false;
]]>
</script>
<goto next="cellar.vxml#init"/>
</block>
</form>
<form id="quit">
<field name="answer">
<noinput> Hey, don't sleep! </noinput>
<nomatch> Say 'yes' or 'no' </nomatch>
<prompt> So you want to get out of here. Are you sure? </prompt>
<grammar src="yesno.grxml"/>
<filled>
<if cond="answer == 'yes'">
<prompt> It seems you really want to leave. Ok then, bye. </prompt>
<exit/>
<else/>
<prompt>
You've changed your mind? That's good, let's start again.
</prompt>
<goto next="#init"/>
</if>
</filled>
</field>
</form>
</vxml>
uhall.vxml
xml version="1.0" encoding="UTF-8"
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml" application="main.vxml">
<meta name="author"
content="Vit Novacek, Faculty of Informatics, Masaryk University Brno,
Czaech Republic"/>
<meta name="copyright"
content="Copyright (c) 2004 Vit Novacek; You can redistribute and/or modify
this file under the terms of the GNU General Public License"/>
<form id="init">
<block>
<prompt>
You are in an upper hall. There are stairs leading down to the lower
hall. There is a bedroom door on the left side of the hall and
children room door on the right side. What do you want to do?
</prompt>
</block>
<field name="action">
<noinput> Come on, you need to get home! </noinput>
<nomatch> Try to say something else. </nomatch>
<grammar src="uhall.grxml"/>
<grammar src="exit.grxml"/>
</field>
<filled namelist="action">
<if cond="action == 'exit'">
<goto next="#exit"/>
<else/>
<script>
<![CDATA[
var intact=parseInt(action,10);
trigger=process2(intact);
]]>
</script>
<prompt><value expr="prompt"/></prompt>
<if cond="trigger==1">
<goto next="lhall.vxml#init"/>
<elseif cond="trigger==2"/>
<goto next="broom.vxml#init"/>
<elseif cond="trigger==3"/>
<goto next="croom.vxml#init"/>
<else/>
<goto next="#init"/>
</if>
</if>
</filled>
</form>
<form id="exit">
<field name="exit_ask">
<noinput> Hey, don't sleep! </noinput>
<nomatch> Say 'yes' or 'no' </nomatch>
<prompt> Do you really want to stop playing the game? </prompt>
<grammar src="yesno.grxml"/>
<filled>
<if cond="exit_ask=='yes'">
<prompt> Ok, let's go to the initial stage. </prompt>
<goto next="main.vxml#init"/>
<else/>
<prompt>
You've changed your mind? That's good, game continues...
</prompt>
<goto next="#init"/>
</if>
</filled>
</field>
</form>
</vxml>
broom.grxml
xml version="1.0" encoding="UTF-8"
<grammar root="command" version="1.0" xmllang="en">
<meta name="author"
content="Vit Novacek, Faculty of Informatics, Masaryk University Brno,
Czaech Republic"/>
<meta name="copyright"
content="Copyright (c) 2004 Vit Novacek; You can redistribute and/or modify
this file under the terms of the GNU General Public License"/>
<rule id="command" scope="public">
<item repeat="0-1"><ruleref uri="#modus"/></item>
<one-of>
<item>go <ruleref uri="#places"/><tag>out.action=rules.places</tag></item>
<item><ruleref uri="#exam"/><tag>out.action=rules.exam</tag></item>
<item><ruleref uri="#take"/><tag>out.action=rules.take</tag></item>
<item><ruleref uri="#use"/><tag>out.action=rules.use</tag></item>
<item><ruleref uri="#invent"/><tag>out.action=255</tag></item>
</one-of>
</rule>
<rule id="invent">
<one-of>
<item>see</item>
<item>know</item>
</one-of>
<one-of>
<item>what</item>
<item>the stuff</item>
<item>my loot</item>
</one-of>
<item repeat="0-1">I have</item>
</rule>
<rule id="modus">
<one-of>
<item>I'd like to</item>
<item>I want to</item>
<item>I wanna</item>
</one-of>
</rule>
<rule id="places">
<item><ruleref uri="#back"/><tag>out=10</tag></item>
</rule>
<rule id="exam">
<one-of>
<item>examine</item>
<item>look at</item>
</one-of>
<item repeat="0-1">the</item>
<item><ruleref uri="#cat"/><tag>out=20</tag></item>
</rule>
<rule id="take">
<one-of>
<item>take</item>
<item>pick up</item>
</one-of>
<item repeat="0-1">the</item>
<item><ruleref uri="#cat"/><tag>out=30</tag></item>
</rule>
<rule id="use">
<item>use</item>
<item repeat="0-1">the</item>
<one-of>
<item><ruleref uri="#trap"/><tag>out=40</tag></item>
<item><ruleref uri="#beer"/><tag>out=41</tag></item>
<item><ruleref uri="#cheese"/><tag>out=42</tag></item>
<item><ruleref uri="#cat"/><tag>out=43</tag></item>
<item><ruleref uri="#wand"/><tag>out=44</tag></item>
</one-of>
</rule>
<rule id="back">
<one-of>
<item>back</item>
<item><ruleref uri="#hall"/></item>
</one-of>
</rule>
<rule id="hall">
<item repeat="0-1">back</item>
<item>to</item>
<item repeat="0-1">the</item>
<item repeat="0-1">upper</item>
<item>hall</item>
</rule>
<rule id="trap">
<item repeat="0-1">mouse</item><item>trap</item>
</rule>
<rule id="beer">
<item>beer</item><item repeat="0-1">can</item>
</rule>
<rule id="cheese">
<item repeat="0-1">piece of</item>
<item>cheese</item>
</rule>
<rule id="cat">
<item repeat="0-1">black</item>
<item>cat</item>
</rule>
<rule id="wand">
<item repeat="0-1">magic</item><item>wand</item>
</rule>
</grammar>
cellar.grxml
xml version="1.0" encoding="UTF-8"
<grammar root="command" version="1.0" xmllang="en">
<meta name="author"
content="Vit Novacek, Faculty of Informatics, Masaryk University Brno,
Czaech Republic"/>
<meta name="copyright"
content="Copyright (c) 2004 Vit Novacek; You can redistribute and/or modify
this file under the terms of the GNU General Public License"/>
<rule id="command" scope="public">
<item repeat="0-1"><ruleref uri="#modus"/></item>
<one-of>
<item>go <ruleref uri="#places"/><tag>out.action=rules.places</tag></item>
<item><ruleref uri="#exam"/><tag>out.action=rules.exam</tag></item>
<item><ruleref uri="#take"/><tag>out.action=rules.take</tag></item>
<item><ruleref uri="#use"/><tag>out.action=rules.use</tag></item>
<item><ruleref uri="#invent"/><tag>out.action=255</tag></item>
</one-of>
</rule>
<rule id="invent">
<one-of>
<item>see</item>
<item>know</item>
</one-of>
<one-of>
<item>what</item>
<item>the stuff</item>
<item>my loot</item>
</one-of>
<item repeat="0-1">I have</item>
</rule>
<rule id="modus">
<one-of>
<item>I'd like to</item>
<item>I want to</item>
<item>I wanna</item>
</one-of>
</rule>
<rule id="places">
<one-of>
<item>upstairs <tag>out=10</tag></item>
<item>up <tag>out=10</tag></item>
</one-of>
</rule>
<rule id="exam">
<one-of>
<item>examine</item>
<item>look at</item>
</one-of>
<item repeat="0-1">the</item>
<one-of>
<item><ruleref uri="#trap"/><tag>out=20</tag></item>
<item><ruleref uri="#machine"/><tag>out=21</tag></item>
<item><ruleref uri="#beer"/><tag>out=22</tag></item>
</one-of>
</rule>
<rule id="take">
<one-of>
<item>take</item>
<item>pick up</item>
</one-of>
<item repeat="0-1">the</item>
<one-of>
<item><ruleref uri="#trap"/><tag>out=30</tag></item>
<item><ruleref uri="#machine"/><tag>out=31</tag></item>
<item><ruleref uri="#beer"/><tag>out=32</tag></item>
</one-of>
</rule>
<rule id="use">
<item>use</item>
<item repeat="0-1">the</item>
<one-of>
<item><ruleref uri="#trap"/><tag>out=40</tag></item>
<item><ruleref uri="#machine"/><tag>out=41</tag></item>
<item><ruleref uri="#beer"/><tag>out=42</tag></item>
<item><ruleref uri="#cheese"/><tag>out=43</tag></item>
<item><ruleref uri="#cat"/><tag>out=44</tag></item>
<item><ruleref uri="#wand"/><tag>out=45</tag></item>
</one-of>
</rule>
<rule id="trap">
<item repeat="0-1">mouse</item><item>trap</item>
</rule>
<rule id="machine">
<item repeat="0-1">washing</item><item>machine</item>
</rule>
<rule id="beer">
<item>beer</item><item repeat="0-1">can</item>
</rule>
<rule id="cheese">
<item>cheese</item>
</rule>
<rule id="cat">
<item>cat</item>
</rule>
<rule id="wand">
<item repeat="0-1">magic</item><item>wand</item>
</rule>
</grammar>
croom.grxml
xml version="1.0" encoding="UTF-8"
<grammar root="command" version="1.0" xmllang="en">
<meta name="author"
content="Vit Novacek, Faculty of Informatics, Masaryk University Brno,
Czaech Republic"/>
<meta name="copyright"
content="Copyright (c) 2004 Vit Novacek; You can redistribute and/or modify
this file under the terms of the GNU General Public License"/>
<rule id="command" scope="public">
<item repeat="0-1"><ruleref uri="#modus"/></item>
<one-of>
<item>go <ruleref uri="#places"/><tag>out.action=rules.places</tag></item>
<item><ruleref uri="#exam"/><tag>out.action=rules.exam</tag></item>
<item><ruleref uri="#take"/><tag>out.action=rules.take</tag></item>
<item><ruleref uri="#use"/><tag>out.action=rules.use</tag></item>
<item><ruleref uri="#invent"/><tag>out.action=255</tag></item>
</one-of>
</rule>
<rule id="invent">
<one-of>
<item>see</item>
<item>know</item>
</one-of>
<one-of>
<item>what</item>
<item>the stuff</item>
<item>my loot</item>
</one-of>
<item repeat="0-1">I have</item>
</rule>
<rule id="modus">
<one-of>
<item>I'd like to</item>
<item>I want to</item>
<item>I wanna</item>
</one-of>
</rule>
<rule id="places">
<item><ruleref uri="#back"/><tag>out=10</tag></item>
</rule>
<rule id="exam">
<one-of>
<item>examine</item>
<item>look at</item>
</one-of>
<item repeat="0-1">the</item>
<item><ruleref uri="#statue"/><tag>out=20</tag></item>
</rule>
<rule id="take">
<one-of>
<item>take</item>
<item>pick up</item>
</one-of>
<item repeat="0-1">the</item>
<item><ruleref uri="#statue"/><tag>out=30</tag></item>
</rule>
<rule id="use">
<item>use</item>
<item repeat="0-1">the</item>
<one-of>
<item><ruleref uri="#trap"/><tag>out=40</tag></item>
<item><ruleref uri="#beer"/><tag>out=41</tag></item>
<item><ruleref uri="#cheese"/><tag>out=42</tag></item>
<item><ruleref uri="#cat"/><tag>out=43</tag></item>
<item><ruleref uri="#wand"/><tag>out=44</tag></item>
</one-of>
</rule>
<rule id="back">
<one-of>
<item>back</item>
<item><ruleref uri="#hall"/></item>
</one-of>
</rule>
<rule id="hall">
<item repeat="0-1">back</item>
<item>to</item>
<item repeat="0-1">the</item>
<item repeat="0-1">upper</item>
<item>hall</item>
</rule>
<rule id="statue">
<item repeat="0-1">Harry Potter</item><item repeat="0-1">'s</item>
<one-of>
<item>statue</item>
<item>statuette</item>
<item><ruleref uri="#wand"/></item>
</one-of>
</rule>
<rule id="trap">
<item repeat="0-1">mouse</item><item>trap</item>
</rule>
<rule id="beer">
<item>beer</item><item repeat="0-1">can</item>
</rule>
<rule id="cheese">
<item repeat="0-1">piece of</item>
<item>cheese</item>
</rule>
<rule id="cat">
<item repeat="0-1">black</item>
<item>cat</item>
</rule>
<rule id="wand">
<item repeat="0-1">magic</item><item>wand</item>
</rule>
</grammar>
exit.grxml
xml version="1.0" encoding="UTF-8"
<grammar root="main" version="1.0" xmllang="en">
<meta name="author"
content="Vit Novacek, Faculty of Informatics, Masaryk University Brno,
Czaech Republic"/>
<meta name="copyright"
content="Copyright (c) 2004 Vit Novacek; You can redistribute and/or modify
this file under the terms of the GNU General Public License"/>
<rule id="main" scope="public">
<item> <ruleref uri="#ctd"/> <tag>out="exit"</tag> </item>
</rule>
<rule id="ctd">
<one-of>
<item>
<item repeat="0-1"> I want to </item>
<one-of>
<item> exit </item>
<item> leave </item>
<item> quit </item>
</one-of>
<item repeat="0-1"> please </item>
</item>
<item repeat="1-2">
bye
</item>
</one-of>
</rule>
</grammar>
kitchen.grxml
xml version="1.0" encoding="UTF-8"
<grammar root="command" version="1.0" xmllang="en">
<meta name="author"
content="Vit Novacek, Faculty of Informatics, Masaryk University Brno,
Czaech Republic"/>
<meta name="copyright"
content="Copyright (c) 2004 Vit Novacek; You can redistribute and/or modify
this file under the terms of the GNU General Public License"/>
<rule id="command" scope="public">
<item repeat="0-1"><ruleref uri="#modus"/></item>
<one-of>
<item>go <ruleref uri="#places"/><tag>out.action=rules.places</tag></item>
<item><ruleref uri="#exam"/><tag>out.action=rules.exam</tag></item>
<item><ruleref uri="#take"/><tag>out.action=rules.take</tag></item>
<item><ruleref uri="#use"/><tag>out.action=rules.use</tag></item>
<item><ruleref uri="#invent"/><tag>out.action=255</tag></item>
</one-of>
</rule>
<rule id="invent">
<one-of>
<item>see</item>
<item>know</item>
</one-of>
<one-of>
<item>what</item>
<item>the stuff</item>
<item>my loot</item>
</one-of>
<item repeat="0-1">I have</item>
</rule>
<rule id="modus">
<one-of>
<item>I'd like to</item>
<item>I want to</item>
<item>I wanna</item>
</one-of>
</rule>
<rule id="places">
<item><ruleref uri="#back"/><tag>out=10</tag></item>
</rule>
<rule id="exam">
<one-of>
<item>examine</item>
<item>look at</item>
</one-of>
<item repeat="0-1">the</item>
<one-of>
<item><ruleref uri="#cheese"/><tag>out=20</tag></item>
<item><ruleref uri="#lady"/><tag>out=21</tag></item>
</one-of>
</rule>
<rule id="take">
<one-of>
<item>take</item>
<item>pick up</item>
</one-of>
<item repeat="0-1">the</item>
<item><ruleref uri="#cheese"/><tag>out=30</tag></item>
</rule>
<rule id="use">
<item>use</item>
<item repeat="0-1">the</item>
<one-of>
<item><ruleref uri="#trap"/><tag>out=40</tag></item>
<item><ruleref uri="#lady"/><tag>out=41</tag></item>
<item><ruleref uri="#beer"/><tag>out=42</tag></item>
<item><ruleref uri="#cheese"/><tag>out=43</tag></item>
<item><ruleref uri="#cat"/><tag>out=44</tag></item>
<item><ruleref uri="#wand"/><tag>out=45</tag></item>
</one-of>
</rule>
<rule id="back">
<one-of>
<item>back</item>
<item><ruleref uri="#hall"/></item>
</one-of>
</rule>
<rule id="hall">
<item repeat="0-1">back</item>
<item>to</item>
<item repeat="0-1">the</item>
<item repeat="0-1">lower</item>
<item>hall</item>
</rule>
<rule id="lady">
<item repeat="0-1">fat</item>
<item repeat="0-1">corpulent</item>
<item repeat="0-1">tornado</item>
<one-of>
<item>lady</item>
<item>women</item>
<item>creature</item>
<item>being</item>
</one-of>
</rule>
<rule id="trap">
<item repeat="0-1">mouse</item><item>trap</item>
</rule>
<rule id="palm">
<item repeat="0-1">green</item><item>palm</item>
</rule>
<rule id="beer">
<item>beer</item><item repeat="0-1">can</item>
</rule>
<rule id="cheese">
<item repeat="0-1">piece of</item>
<item>cheese</item>
</rule>
<rule id="cat">
<item>cat</item>
</rule>
<rule id="wand">
<item repeat="0-1">magic</item><item>wand</item>
</rule>
</grammar>
lhall.grxml
xml version="1.0" encoding="UTF-8"
<grammar root="command" version="1.0" xmllang="en">
<meta name="author"
content="Vit Novacek, Faculty of Informatics, Masaryk University Brno,
Czaech Republic"/>
<meta name="copyright"
content="Copyright (c) 2004 Vit Novacek; You can redistribute and/or modify
this file under the terms of the GNU General Public License"/>
<rule id="command" scope="public">
<item repeat="0-1"><ruleref uri="#modus"/></item>
<one-of>
<item>go <ruleref uri="#places"/><tag>out.action=rules.places</tag></item>
<item><ruleref uri="#exam"/><tag>out.action=rules.exam</tag></item>
<item><ruleref uri="#take"/><tag>out.action=rules.take</tag></item>
<item><ruleref uri="#use"/><tag>out.action=rules.use</tag></item>
<item><ruleref uri="#invent"/><tag>out.action=255</tag></item>
</one-of>
</rule>
<rule id="invent">
<one-of>
<item>see</item>
<item>know</item>
</one-of>
<one-of>
<item>what</item>
<item>the stuff</item>
<item>my loot</item>
</one-of>
<item repeat="0-1">I have</item>
</rule>
<rule id="modus">
<one-of>
<item>I'd like to</item>
<item>I want to</item>
<item>I wanna</item>
</one-of>
</rule>
<rule id="places">
<one-of>
<item><ruleref uri="#up"/><tag>out=10</tag></item>
<item><ruleref uri="#down"/><tag>out=11</tag></item>
<item><ruleref uri="#left"/><tag>out=12</tag></item>
<item><ruleref uri="#right"/><tag>out=13</tag></item>
<item><ruleref uri="#out"/><tag>out=14</tag></item>
</one-of>
</rule>
<rule id="exam">
<one-of>
<item>examine</item>
<item>look at</item>
</one-of>
<item repeat="0-1">the</item>
<item><ruleref uri="#palm"/><tag>out=20</tag></item>
</rule>
<rule id="take">
<one-of>
<item>take</item>
<item>pick up</item>
</one-of>
<item repeat="0-1">the</item>
<item><ruleref uri="#palm"/><tag>out=30</tag></item>
</rule>
<rule id="use">
<item>use</item>
<item repeat="0-1">the</item>
<one-of>
<item><ruleref uri="#trap"/><tag>out=40</tag></item>
<item><ruleref uri="#palm"/><tag>out=41</tag></item>
<item><ruleref uri="#beer"/><tag>out=42</tag></item>
<item><ruleref uri="#cheese"/><tag>out=43</tag></item>
<item><ruleref uri="#cat"/><tag>out=44</tag></item>
<item><ruleref uri="#wand"/><tag>out=45</tag></item>
</one-of>
</rule>
<rule id="up">
<one-of><item>up</item><item>upstairs</item></one-of>
</rule>
<rule id="down">
<one-of>
<item>down</item>
<item>downstairs</item>
<item><ruleref uri="#cellar"/></item>
</one-of>
</rule>
<rule id="cellar">
<item>to</item>
<item repeat="0-1">the</item>
<item>cellar</item>
</rule>
<rule id="left">
<one-of>
<item>left</item>
<item><ruleref uri="#kitchen"/></item>
</one-of>
</rule>
<rule id="kitchen">
<item>to</item>
<item repeat="0-1">the</item>
<one-of>
<item>left</item>
<item>kitchen</item>
</one-of>
</rule>
<rule id="right">
<one-of>
<item>right</item>
<item><ruleref uri="#lroom"/></item>
</one-of>
</rule>
<rule id="lroom">
<item>to</item>
<item repeat="0-1">the</item>
<one-of>
<item>right</item>
<item>living room</item>
</one-of>
</rule>
<rule id="out">
<one-of>
<item>out</item>
<item>outdoors</item>
<item><ruleref uri="#edoor"/></item>
</one-of>
</rule>
<rule id="edoor">
<item>to</item>
<item repeat="0-1">the</item>
<item>entrance</item>
<item repeat="0-1">door</item>
</rule>
<rule id="trap">
<item repeat="0-1">mouse</item><item>trap</item>
</rule>
<rule id="palm">
<item repeat="0-1">green</item><item>palm</item>
</rule>
<rule id="beer">
<item>beer</item><item repeat="0-1">can</item>
</rule>
<rule id="cheese">
<item>cheese</item>
</rule>
<rule id="cat">
<item>cat</item>
</rule>
<rule id="wand">
<item repeat="0-1">magic</item><item>wand</item>
</rule>
</grammar>
lroom.grxml
xml version="1.0" encoding="UTF-8"
<grammar root="command" version="1.0" xmllang="en">
<meta name="author"
content="Vit Novacek, Faculty of Informatics, Masaryk University Brno,
Czaech Republic"/>
<meta name="copyright"
content="Copyright (c) 2004 Vit Novacek; You can redistribute and/or modify
this file under the terms of the GNU General Public License"/>
<rule id="command" scope="public">
<item repeat="0-1"><ruleref uri="#modus"/></item>
<one-of>
<item>go <ruleref uri="#places"/><tag>out.action=rules.places</tag></item>
<item><ruleref uri="#exam"/><tag>out.action=rules.exam</tag></item>
<item><ruleref uri="#take"/><tag>out.action=rules.take</tag></item>
<item><ruleref uri="#use"/><tag>out.action=rules.use</tag></item>
<item><ruleref uri="#invent"/><tag>out.action=255</tag></item>
</one-of>
</rule>
<rule id="invent">
<one-of>
<item>see</item>
<item>know</item>
</one-of>
<one-of>
<item>what</item>
<item>the stuff</item>
<item>my loot</item>
</one-of>
<item repeat="0-1">I have</item>
</rule>
<rule id="modus">
<one-of>
<item>I'd like to</item>
<item>I want to</item>
<item>I wanna</item>
</one-of>
</rule>
<rule id="places">
<item><ruleref uri="#back"/><tag>out=10</tag></item>
</rule>
<rule id="exam">
<one-of>
<item>examine</item>
<item>look at</item>
</one-of>
<item repeat="0-1">the</item>
<one-of>
<item><ruleref uri="#tv"/><tag>out=20</tag></item>
<item><ruleref uri="#man"/><tag>out=21</tag></item>
</one-of>
</rule>
<rule id="take">
<one-of>
<item>take</item>
<item>pick up</item>
</one-of>
<item repeat="0-1">the</item>
<item><ruleref uri="#tv"/><tag>out=30</tag></item>
</rule>
<rule id="use">
<item>use</item>
<item repeat="0-1">the</item>
<one-of>
<item><ruleref uri="#trap"/><tag>out=40</tag></item>
<item><ruleref uri="#man"/><tag>out=41</tag></item>
<item><ruleref uri="#beer"/><tag>out=42</tag></item>
<item><ruleref uri="#cheese"/><tag>out=43</tag></item>
<item><ruleref uri="#cat"/><tag>out=44</tag></item>
<item><ruleref uri="#wand"/><tag>out=45</tag></item>
</one-of>
</rule>
<rule id="man">
<item repeat="0-1">Homer Simpson like</item>
<one-of>
<item>man</item>
<item>chap</item>
<item>folk</item>
</one-of>
</rule>
<rule id="tv">
<one-of>
<item>TV</item>
<item>television</item>
</one-of>
</rule>
<rule id="back">
<one-of>
<item>back</item>
<item><ruleref uri="#hall"/></item>
</one-of>
</rule>
<rule id="hall">
<item repeat="0-1">back</item>
<item>to</item>
<item repeat="0-1">the</item>
<item repeat="0-1">lower</item>
<item>hall</item>
</rule>
<rule id="trap">
<item repeat="0-1">mouse</item><item>trap</item>
</rule>
<rule id="beer">
<item>beer</item><item repeat="0-1">can</item>
</rule>
<rule id="cheese">
<item repeat="0-1">piece of</item>
<item>cheese</item>
</rule>
<rule id="cat">
<item>cat</item>
</rule>
<rule id="wand">
<item repeat="0-1">magic</item><item>wand</item>
</rule>
</grammar>
uhall.grxml
xml version="1.0" encoding="UTF-8"
<grammar root="command" version="1.0" xmllang="en">
<meta name="author"
content="Vit Novacek, Faculty of Informatics, Masaryk University Brno,
Czaech Republic"/>
<meta name="copyright"
content="Copyright (c) 2004 Vit Novacek; You can redistribute and/or modify
this file under the terms of the GNU General Public License"/>
<rule id="command" scope="public">
<item repeat="0-1"><ruleref uri="#modus"/></item>
<one-of>
<item>go <ruleref uri="#places"/><tag>out.action=rules.places</tag></item>
<item><ruleref uri="#use"/><tag>out.action=rules.use</tag></item>
<item><ruleref uri="#invent"/><tag>out.action=255</tag></item>
</one-of>
</rule>
<rule id="invent">
<one-of>
<item>see</item>
<item>know</item>
</one-of>
<one-of>
<item>what</item>
<item>the stuff</item>
<item>my loot</item>
</one-of>
<item repeat="0-1">I have</item>
</rule>
<rule id="modus">
<one-of>
<item>I'd like to</item>
<item>I want to</item>
<item>I wanna</item>
</one-of>
</rule>
<rule id="places">
<one-of>
<item><ruleref uri="#down"/><tag>out=10</tag></item>
<item><ruleref uri="#left"/><tag>out=11</tag></item>
<item><ruleref uri="#right"/><tag>out=12</tag></item>
</one-of>
</rule>
<rule id="use">
<item>use</item>
<item repeat="0-1">the</item>
<one-of>
<item><ruleref uri="#trap"/><tag>out=40</tag></item>
<item><ruleref uri="#beer"/><tag>out=41</tag></item>
<item><ruleref uri="#cheese"/><tag>out=42</tag></item>
<item><ruleref uri="#cat"/><tag>out=43</tag></item>
<item><ruleref uri="#wand"/><tag>out=44</tag></item>
</one-of>
</rule>
<rule id="down">
<one-of>
<item>down</item>
<item>downstairs</item>
<item><ruleref uri="#lhall"/></item>
</one-of>
</rule>
<rule id="lhall">
<item>to</item>
<item repeat="0-1">the</item>
<item>lower hall</item>
</rule>
<rule id="left">
<one-of>
<item>left</item>
<item><ruleref uri="#broom"/></item>
</one-of>
</rule>
<rule id="broom">
<item>to</item>
<item repeat="0-1">the</item>
<one-of>
<item>left</item>
<item>bedroom</item>
</one-of>
</rule>
<rule id="right">
<one-of>
<item>right</item>
<item><ruleref uri="#croom"/></item>
</one-of>
</rule>
<rule id="croom">
<item>to</item>
<item repeat="0-1">the</item>
<one-of>
<item>right</item>
<item>children room</item>
</one-of>
</rule>
<rule id="trap">
<item repeat="0-1">mouse</item><item>trap</item>
</rule>
<rule id="palm">
<item repeat="0-1">green</item><item>palm</item>
</rule>
<rule id="beer">
<item>beer</item><item repeat="0-1">can</item>
</rule>
<rule id="cheese">
<item>cheese</item>
</rule>
<rule id="cat">
<item>cat</item>
</rule>
<rule id="wand">
<item repeat="0-1">magic</item><item>wand</item>
</rule>
</grammar>
yesno.grxml
xml version="1.0" encoding="UTF-8"
<grammar root="main" version="1.0" xmllang="en" tag-format="semantics/1.0-literals">
<meta name="author"
content="Vit Novacek, Faculty of Informatics, Masaryk University Brno,
Czaech Republic"/>
<meta name="copyright"
content="Copyright (c) 2004 Vit Novacek; You can redistribute and/or modify
this file under the terms of the GNU General Public License"/>
<rule id="main" scope="public">
<one-of>
<item><ruleref uri="#yes"/><tag>yes</tag></item>
<item><ruleref uri="#no"/><tag>no</tag></item>
</one-of>
<item repeat="0-1"><ruleref uri="#politness"/></item>
</rule>
<rule id="yes">
<one-of>
<item>yes</item>
<item>yeah</item>
<item>yep</item>
<item>sure</item>
<item>of course</item>
</one-of>
</rule>
<rule id="no">
<one-of>
<item>no</item>
<item>not</item>
<item>nope</item>
</one-of>
</rule>
<rule id="politness">
<one-of>
<item> please </item>
<item> thanks </item>
<item> thank you </item>
</one-of>
</rule>
</grammar>