/**
 * adVenture's game engine
 *
 * @param story The story to play
 * @param screen The DOM element where the text must be displayed
 * @param input The DOM element where the player will type his choices
 * @param form The DOM element of the form to enter the action
 * @param scene Placeholder, the current scene to play
 * @param updateScreen Placeholder, function to update the screen with the new
 * 		scene
 * @param newSceneIndex Placeholder, index of the next scene to play
 */
var engine=function(story,screen,input,form,scene,updateScreen,newSceneIndex,value){
	value='value';
	// Set the initial scene
	scene=story._start_;
	// define the function to update the screen with a scene description
	updateScreen=function(){
		screen.innerHTML+=scene.description;
	}
	// event to validate the user's choice
	form.onsubmit=function(){
		// get the chosen scene's index
		newSceneIndex=scene.links[input[value]];
		input[value]='';
		input.focus();
		if(newSceneIndex){
			// update the current scene
			scene=story[newSceneIndex];
			updateScreen();
		}
		return false;
	}

	// initial screen update
	updateScreen();
};

@@ -952,11 +952,8 @@
 ;%0A%09%09
-if(
 newS
@@ -965,45 +965,25 @@
 ndex
-)%7B%0A%09%09%09// update the current scene%0A%09%09%09
+ && updateScreen(
 scen
@@ -1008,32 +1008,10 @@
 dex%5D
+)
 ;
-%0A%09%09%09updateScreen();%0A%09%09%7D
 %0A%09%09r
@@ -1020,13 +1020,10 @@
 urn 
-false
+!1
 ;%0A%09%7D

test updated to be minimisable