// The user will tell us what mode we're in
var $program_mode = $_REQUEST["program_mode"];
switch($program_mode) {
case "list":
output_list();
break;
case "dialog":
output_dialog();
break;
default:
output_main();
}
// Get a line of input from the user
// Keep asking till we get something
function input_prompt($msg) {
var $result = "";
while($result == "") {
$f = display_template("templates/dialog.tpl"
msg => $msg
);
$result = $f["result"] || "";
}
return $result;
}
$verb = input_prompt("Give me a past-tense verb.");
$noun1 = input_prompt("Give me a noun.");
$noun2 = input_prompt("Give me another noun.");
display("The $noun1 $verb the $noun2!");
$obj = new $class;
$obj = new Contize($obj);