

//define the dungeon floorplan matrix
//the outer matrix length is the number of rows in the grid
//the inner array lengths are the number of squares in the row
var floorplan = [['0000','0000','0000','0000','0000','0100','0110','0111','0111','0111','0111','0111','0111','0111','0111','0111','0111','0111','0111','0111','0111','0011','0001','0000','0000','0000','0000','0000','0000','0000','0000','0000','0000','0000','0000','0000','0000','0100','0110','0011'],['0000','0000','0000','0000','0000','0100','1110','1111','1101','1101','1101','1101','1101','1101','1111','1111','1101','1101','1101','1101','1111','1011','0001','0000','0000','0000','0010','0010','0010','0010','0010','0010','0010','0010','0010','0010','0010','0110','1110','1011'],['0000','0000','0000','0000','0000','0100','1110','1011','1001','1000','1000','1000','1000','1100','1110','1011','1001','1000','1000','1100','1110','1011','0001','0000','0000','0100','0110','0111','0111','0111','0111','0111','0111','0111','0111','0111','0111','0111','1111','1011'],['0010','0010','0010','0010','0010','0110','1110','1011','0011','0010','0010','0010','0010','0110','1110','1011','0001','0000','0000','0100','1110','1011','0001','0000','0000','0100','1110','1111','1101','1101','1101','1101','1101','1101','1101','1101','1101','1101','1101','1001'],['0110','0111','0111','0111','0111','0111','1111','1111','0111','0111','0111','0111','0111','0111','1111','1011','0001','0000','0000','0100','1110','1011','0001','0000','0000','0100','1110','1011','1001','1000','1000','1000','1000','1000','1000','1000','1000','1000','1000','1000'],['1110','1111','1101','1101','1101','1101','1111','1111','1101','1101','1101','1101','1101','1101','1101','1001','0001','0000','0000','0100','1110','1011','0001','0000','0000','0100','1110','1011','0011','0010','0010','0010','0010','0010','0010','0010','0000','0000','0000','0000'],['1110','1011','1001','1000','1000','1100','1110','1011','1001','1000','1000','1000','1000','1000','1000','1000','0000','0000','0000','0100','1110','1011','0001','0000','0000','0100','1110','1111','0111','0111','0111','0111','0111','0111','0111','0011','0001','0000','0000','0000'],['1110','1011','0001','0000','0000','0100','1110','1011','0011','0010','0010','0010','0010','0010','0010','0010','0010','0010','0010','0110','1110','1011','0001','0000','0000','0100','1110','1111','1101','1101','1111','1111','1101','1101','1111','1011','0001','0000','0010','0010'],['1110','1011','0001','0000','0000','0100','1110','1111','0111','0111','0111','0111','0111','0111','0111','0111','0111','0111','0111','0111','1111','1011','0001','0000','0000','0100','1110','1011','1001','1100','1110','1011','1001','1100','1110','1011','0001','0100','0110','0011'],['1110','1011','0001','0000','0000','0100','1110','1111','1101','1101','1101','1101','1101','1101','1101','1101','1101','1101','1101','1101','1101','1001','0001','0000','0000','0100','1110','1011','0001','0100','1110','1011','0001','0100','1110','1011','0001','0100','1110','1011'],['1110','1011','0001','0000','0000','0100','1110','1011','1001','1000','1000','1000','1000','1000','1000','1000','1000','1000','1000','1000','1000','1000','0000','0000','0000','0100','1110','1011','0001','0100','1110','1011','0001','0100','1110','1011','0001','0100','1110','1011'],['1110','1011','0001','0000','0000','0100','1110','1011','0011','0010','0010','0010','0010','0010','0010','0010','0010','0010','0010','0010','0000','0000','0000','0000','0000','0100','1110','1011','0011','0110','1110','1011','0011','0110','1110','1011','0011','0110','1110','1011'],['1110','1011','0001','0000','0000','0100','1110','1111','0111','0111','0111','0111','0111','0111','0111','0111','0111','0111','0111','0011','0001','0000','0000','0000','0000','0100','1110','1111','0111','0111','1111','1111','0111','0111','1111','1111','0111','0111','1111','1011'],['1110','1011','0001','0000','0000','0100','1100','1101','1101','1101','1111','1111','1101','1101','1101','1101','1101','1101','1111','1011','0001','0000','0000','0000','0000','0100','1110','1111','1101','1101','1111','1111','1101','1101','1101','1101','1101','1101','1101','1001'],['1110','1011','0001','0000','0000','0000','1000','1000','1000','1100','1110','1011','1001','1000','1000','1000','1000','1100','1110','1011','0001','0000','0000','0000','0000','0100','1110','1011','1001','1100','1110','1011','1001','1000','1000','1000','1000','1000','1000','1000'],['1110','1011','0001','0000','0000','0000','0000','0000','0010','0110','1110','1011','0011','0010','0010','0010','0000','0100','1110','1011','0011','0010','0010','0010','0010','0110','1110','1011','0011','0110','1110','1011','0001','0000','0000','0000','0000','0000','0000','0000'],['1110','1011','0001','0000','0000','0000','0000','0100','0110','0111','1111','1111','0111','0111','0111','0011','0001','0100','1110','1111','0111','0111','0111','0111','0111','0111','1111','1111','0111','0111','1111','1011','0001','0000','0000','0000','0000','0000','0000','0000'],['1110','1011','0001','0000','0000','0000','0000','0100','1110','1111','1101','1101','1101','1101','1101','1001','0001','0100','1100','1101','1101','1101','1101','1101','1101','1101','1101','1101','1101','1101','1101','1001','0001','0000','0000','0000','0000','0000','0000','0000'],['1110','1011','0001','0000','0000','0000','0000','0100','1110','1011','1001','1000','1000','1000','1000','1000','0000','0000','1000','1000','1000','1000','1000','1000','1000','1000','1000','1000','1000','1000','1000','1000','0000','0000','0000','0000','0000','0000','0000','0000'],['1100','1001','0001','0000','0000','0000','0000','0100','1100','1001','0001','0000','0000','0000','0000','0000','0000','0000','0000','0000','0000','0000','0000','0000','0000','0000','0000','0000','0000','0000','0000','0000','0000','0000','0000','0000','0000','0000','0000','0000']];


//define the start position [x, y, dir (0 = north, 1 = east, 2 = south, 3 = west)]
var start = [0, 14, 0];


//define the language object for view captions
var lang = {
	'corridor'		: 'The corridor stretches %n meters in front of you%ends. ',
	'ends-turns'	: ', then turns %dir',
	'ends-tjunct'	: ' to a T-junction',
	'ends-dead'		: ' to a dead end',
	'dir-left'		: 'left',
	'dir-right'		: 'right',
	'facing-wall'	: 'You\'re standing in front of a wall%with. ',
	'facing-with'	: ', with a corridor to your %dir',
	'facing-nowith'	: ' at a dead end',
	'openings'		: 'On the %dir wall %opcount%nextto%after%opat. ',
	'opcount-one'	: 'there\'s a passage',
	'opcount-many'	: 'there are passages',
	'nextto'		: ' right next to you',
	'after'			: ' after ',
	'opat'			: '%n meters',
	'comma' 		: ', ',
	'and'			: ' and '
	};





//instantiate the DungeonView object
//required: floorplan, start position, lang object
//optional: view change callback function
new DungeonView(floorplan, start, lang, viewchange);

