// the maze array
function sethelpertext()
{
  // pick map up
  HELPER_TEXT[0] = "<span class=\"colred\">Aha! A map! Click the map icon on the right to examine it more closely.</span>";
  // put map down - not needed!
  HELPER_TEXT[1] = "<span class=\"colred\">Please do-do click on the map icon on the right to return to the maze.</span>";
  // teapot pick up
  HELPER_TEXT[2] = "<span class=\"colred\">Aha! A teapot! Click the teapot icon on the right to see what might happen.</span>";
  // crafty tunnel pick up
  HELPER_TEXT[3] = "<span class=\"colred\">Aha! An entrance to the Crafty Tunnel!<br>Click the tunnel icon on the right to gaze into it.</span>";
}

function setmazeplayerdata()
{
  OPTIMUM_STEPS = 85;
  MAP_USE_PENALTY = 5;
  CHALLENGE_FOUND_BOUNS = 5;
  CHALLENGE_ANSWERGOOD_BOUNS = 5;

  gPlayerScore = 0;
  gStepsTaken = 0;
  gPlaqueScore = 0;
  gPlaquesFound = 0;
  gPlaquesCorrect = 0;
  gNumberOfMapsUsed = 0;
  gCatacombsUsed = 0;

  gBestPossibleScore = ((NUM_CHALLENGES-1)*(CHALLENGE_FOUND_BOUNS+CHALLENGE_ANSWERGOOD_BOUNS));
}

// ---------------------------------------------------------------------------
function setteapotplayer()
{
  var c;  
  var playerdone = false;
  var passedcatacombs = true;
  var passedmapcells = true;
  var passedteapot = true;
  while(playerdone==false)
  {
    passedcatacombs = true;
    passedmapcells = true;
    passedteapot = true;

    gTeaPotPlayerX = Math.round((MAZE_WIDTH-1)*Math.random());
    gTeaPotPlayerY = Math.round((MAZE_HEIGHT-1)*Math.random());    
   
    var cellindex = gTeaPotPlayerX +(gTeaPotPlayerY *MAZE_WIDTH);

    var validorientation = false;
    var checkorientation = 0;

    while(validorientation==false)
    {
      var cell_string = TheMaze[cellindex][checkorientation]; 

      var CellView = cell_string.substr(0,2);
      var challengecell = 0;
      if(CellView<10)
      {
        challengecell = CellView.substr(1,1);
      }
      else
      {
        challengecell = CellView;
      }

      if(TheCells[challengecell][1]=="n")
      {        
        validorientation = true;
        gTeaPotPlayerLookDir = checkorientation;        
      }
      else
      {
        checkorientation = checkorientation+1;
      }
    }

    // test for catacombs
    for(c=0; c<NUM_CATACOMBS; c++)
    {
      if(RandomsCatacombs[c]==cellindex)
      {
        passedcatacombs=false;
      }
    }

    // test for map cells    
    for(c=0; c<NUM_MAP_CELLS; c++)
    {
      if(RandomsMapCells[c][0]==cellindex)
      {
        passedmapcells=false;
      }
    }

    // test for being teleported onto teapot ...
    if(gTeaPotPlayerX == gTeaPotX && gTeaPotPlayerY == gTeaPotY)
      passedteapot = false;

    if(passedcatacombs == true && passedmapcells == true && passedteapot == true)
    {
      playerdone = true;
    }
  }
//alert(gTeaPotPlayerX + ", " + gTeaPotPlayerY + " -> " + gTeaPotPlayerLookDir);
}

// ---------------------------------------------------------------------------
function setteapot()
{
  var c;  
  var teapotdone = false;
  var passedcells = true;
  var passedcatacombs = true;
  var passedmapcells = true;
  var passedplayer = true;
  while(teapotdone==false)
  {
    passedcells = true;
    passedcatacombs = true;
    passedmapcells = true;
    passedplayer = true;

    gTeaPotX = Math.round((MAZE_WIDTH-1)*Math.random());
    gTeaPotY = Math.round((MAZE_HEIGHT-1)*Math.random());
   
    var cellindex = gTeaPotX+(gTeaPotY*MAZE_WIDTH);
    for(c=0; c<4; c++)
    {
      var cell_string = TheMaze[cellindex][c]; 

      var CellView = cell_string.substr(0,2);
      var challengecell = 0;
      if(CellView<10)
      {
        challengecell = CellView.substr(1,1);
      }
      else
      {
        challengecell = CellView;
      }
      if(TheCells[challengecell][1]=="c")
      {        
        passedcells = false;
      }
    }

    // test for starting spot for player
    if(gTeaPotX==player_position_x && gTeaPotY==player_position_y)
      passed_cells=false;

    // test for catacombs
    for(c=0; c<NUM_CATACOMBS; c++)
    {
      if(RandomsCatacombs[c]==cellindex)
      {
        passedcatacombs=false;
      }
    }

    // test for map cells    
    for(c=0; c<NUM_MAP_CELLS; c++)
    {
      if(RandomsMapCells[c][0]==cellindex)
      {
        passedmapcells=false;
      }
    }

    // test for being teleported onto teapot ...
    if(gTeaPotPlayerX == gTeaPotX && gTeaPotPlayerY == gTeaPotY)
      passedplayer = false;

    if(passedcells == true && passedcatacombs == true && passedmapcells == true && passedplayer)
    {
      teapotdone = true;
    }
  }
//alert(gTeaPotX + ", " + gTeaPotY);
}

// ---------------------------------------------------------------------------
function setcatacombs()
{
  // RandomsCatacombs 
  // TESTER!
  //RandomsMapCells[0] = 44; 

  RandomsCatacombs[0] = 1;  //B1
  RandomsCatacombs[1] = 9;  //C2
  RandomsCatacombs[2] = 30; //C5
  RandomsCatacombs[3] = 18; //E3
  RandomsCatacombs[4] = 39; //E6
  RandomsCatacombs[5] = 26; //F4
  RandomsCatacombs[6] = 13; //G2
  RandomsCatacombs[7] = 48; //G7
	
  gChosenCatacombCell = Math.round(NUM_CATACOMBS*Math.random());
//  gChosenCatacombCell = 0;
}

// ---------------------------------------------------------------------------
function setrandomsmapcells()
{
  var c;
  for(c=0; c<NUM_MAP_CELLS; c++)
  {
    RandomsMapCells[c] = new Array(3);    
  }

  // 0 = actual index, 1 = cell pos for filename
  RandomsMapCells[0][0] = 41;
  RandomsMapCells[0][1] = "G6";
  RandomsMapCells[0][2] = 0;
  
  RandomsMapCells[1][0] = 38;
  RandomsMapCells[1][1] = "D6";
  RandomsMapCells[1][2] = 0;

  RandomsMapCells[2][0] = 32;
  RandomsMapCells[2][1] = "E5";
  RandomsMapCells[2][2] = 0;

  RandomsMapCells[3][0] = 20;
  RandomsMapCells[3][1] = "G3";
  RandomsMapCells[3][2] = 0;

  RandomsMapCells[4][0] = 12;
  RandomsMapCells[4][1] = "F2";
  RandomsMapCells[4][2] = 0;

  RandomsMapCells[5][0] = 11;
  RandomsMapCells[5][1] = "E2";
  RandomsMapCells[5][2] = 0;

  RandomsMapCells[6][0] = 10;
  RandomsMapCells[6][1] = "D2";
  RandomsMapCells[6][2] = 0;

  RandomsMapCells[7][0] = 2;
  RandomsMapCells[7][1] = "C1";
  RandomsMapCells[7][2] = 0;

  RandomsMapCells[8][0] = 16;
  RandomsMapCells[8][1] = "C3";
  RandomsMapCells[8][2] = 0;

  RandomsMapCells[9][0] = 28;
  RandomsMapCells[9][1] = "A5";
  RandomsMapCells[9][2] = 0;
}

// ---------------------------------------------------------------------------
function resetchallengecelldata()
{
  // item 0 denotes what cell the challenge is in
  // item 1 denotes what the correct answer is
  // item 2 is the number of times this challenge has been attempted and
  // also stores teh answer the player gave. 
 
  // NOT USED!!!
  TheChallenges[0][0] = 0;
  TheChallenges[0][1] = 0;
  TheChallenges[0][2] = 0;

  TheChallenges[1][0] = 46;
  TheChallenges[1][1] = 4;
  TheChallenges[1][2] = 0;

  TheChallenges[2][0] = 43;
  TheChallenges[2][1] = 2;
  TheChallenges[2][2] = 0;

  TheChallenges[3][0] = 14;
  TheChallenges[3][1] = 2;
  TheChallenges[3][2] = 0;

  TheChallenges[4][0] = 7;
  TheChallenges[4][1] = 1;
  TheChallenges[4][2] = 0;

  TheChallenges[5][0] = 17;
  TheChallenges[5][1] = 3;
  TheChallenges[5][2] = 0;

  TheChallenges[6][0] = 0;
  TheChallenges[6][1] = 1;
  TheChallenges[6][2] = 0;

  TheChallenges[7][0] = 6;
  TheChallenges[7][1] = 2;
  TheChallenges[7][2] = 0;

  TheChallenges[8][0] = 47
  TheChallenges[8][1] = 4;
  TheChallenges[8][2] = 0;

  TheChallenges[9][0] = 40;
  TheChallenges[9][1] = 3;
  TheChallenges[9][2] = 0;

  TheChallenges[10][0] = 24;
  TheChallenges[10][1] = 3;
  TheChallenges[10][2] = 0;
}

// ---------------------------------------------------------------------------
function setchallengecells()
{
  var c;
  for(c=0; c<NUM_CHALLENGES; c++)
  {
    TheChallenges[c] = new Array(4);    
  }

  resetchallengecelldata();
}

// ---------------------------------------------------------------------------
function setcelldata()
{
  var c;
  for(c=0; c<NUM_CELL_TYPES; c++)
  {
    TheCells[c] = new Array(5);    
  }

  //EMPTY UNUSED DATA!!!
  TheCells[0][0] = 0;
  TheCells[0][1] = "n"; 
  TheCells[0][2] = 0;
  TheCells[0][3] = "null"
  TheCells[0][4] = "null"

  TheCells[1][0] = 4;
  TheCells[1][1] = "c";
  TheCells[1][2] = 0;
  TheCells[1][3] = "<i>Well done! You've found a Challenge Plaque!</i><br><span class=\"colred\">Click the icon on the right</span> to dodiscover the nature of this Challenge,<br>or <span class=\"colgreen\">turn <i>left</i></span>, or <span class=\"colgreen\">turn <i>right</i></span>";
  TheCells[1][4] = "<i>Commiserations... a blank Challenge Plaque...</i><br>You must have already tried to solve this riddle - now, it is mysteriously empty...<br>All you can do is <span class=\"colgreen\">turn <i>left</i></span>, or <span class=\"colgreen\">turn <i>right</i></span>.";

  TheCells[2][0] = 1;
  TheCells[2][1] = "c";
  TheCells[2][2] = 0;
  TheCells[2][3] = "<i>Well done! You've found a Challenge Plaque!</i><br><span class=\"colred\">Click the icon on the right</span> to dodiscover the nature of this Challenge,<br>or, <span class=\"colgreen\">turn <i>right</i></span> or <span class=\"colgreen\">turn <i>left</i></span> to see what is around the bend...";
  TheCells[2][4] = "<i>Commiserations... a blank Challenge Plaque...</i><br>You must have already tried to solve this riddle - now, it is mysteriously empty...<br>All you can do is <span class=\"colgreen\">turn <i>right</i></span>, or <span class=\"colgreen\">turn <i>left</i></span> to see what is around the bend...";

  TheCells[3][0] = 1;
  TheCells[3][1] = "c";
  TheCells[3][2] = 0;
  TheCells[3][3] = "<i>Well done! You've found a Challenge Plaque!</i><br><span class=\"colred\">Click the icon on the right</span> to dodiscover the nature of this Challenge<br>or <span class=\"colgreen\">turn <i>left</i></span> or <span class=\"colgreen\">turn <i>right</i></span> to see what is around the bend...";
  TheCells[3][4] = "<i>Commiserations... a blank Challenge Plaque...</i><br>You must have already tried to solve this riddle - now, it is mysteriously empty...<br>All you can do is <span class=\"colgreen\">turn <i>left</i></span>, or <span class=\"colgreen\">turn <i>right</i></span> to see what is around the bend...";

  TheCells[4][0] = 1;
  TheCells[4][1] = "n";
  TheCells[4][2] = 0;
  TheCells[4][3] = "Uh-oh!  Looks like a dead end...<br>All you can do is <span class=\"colgreen\">turn <i>left</i></span> or <span class=\"colgreen\">turn <i>right</i></span>.";
  TheCells[4][4] = "";

  TheCells[5][0] = 1;
  TheCells[5][1] = "n";
  TheCells[5][2] = 0;
  TheCells[5][3] = "<span class=\"colgreen\">Turn <i>left</i></span> or <span class=\"colgreen\"><i>right</i></span> to see around either bend...";
  TheCells[5][4] = "";

  TheCells[6][0] = 4;
  TheCells[6][1] = "n";
  TheCells[6][2] = 0;
  TheCells[6][3] = "<span class=\"colgreen\">Turn <i>right</i></span> or <span class=\"colgreen\">turn <i>left</i></span> to see what is around the bend...";
  TheCells[6][4] = "";

  TheCells[7][0] = 4;
  TheCells[7][1] = "n";
  TheCells[7][2] = 0;
  TheCells[7][3] = "<span class=\"colgreen\">Turn <i>left</i></span> or <span class=\"colgreen\">turn <i>right</i></span> to see what is around the bend...";
  TheCells[7][4] = "";

  TheCells[8][0] = 4;
  TheCells[8][1] = "n";
  TheCells[8][2] = 0;
  TheCells[8][3] = "<span class=\"colgreen\">Move <i>forward</i></span> to see where the passage leads <br>or, <span class=\"colgreen\">turn <i>left</i></span> or <span class=\"colgreen\"><i>right</i></span>";
  TheCells[8][4] = "";

  TheCells[9][0] = 4;
  TheCells[9][1] = "n";
  TheCells[9][2] = 0;
  TheCells[9][3] = "<span class=\"colgreen\">Move <i>forward</i></span> to see where the passage leads, or <span class=\"colgreen\">turn <i>right</i></span><br>or <span class=\"colgreen\">turn <i>left</i></span> to see what is around the bend...";
  TheCells[9][4] = "";

  TheCells[10][0] = 4;
  TheCells[10][1] = "n";
  TheCells[10][2] = 0;
  TheCells[10][3] = "<span class=\"colgreen\">Move <i>forward</i></span> to see where the passage leads, or <span class=\"colgreen\">turn <i>left</i></span><br>or <span class=\"colgreen\">turn <i>right</i></span> to see what is around the bend...";
  TheCells[10][4] = "";

  // NOT USED
  TheCells[11][0] = 0;
  TheCells[11][1] = "n";
  TheCells[11][2] = 0;
  TheCells[11][3] = 0;  
  TheCells[11][4] = "";

  TheCells[12][0] = 4;
  TheCells[12][1] = "n";
  TheCells[12][2] = 0;
  TheCells[12][3] = "<span class=\"colgreen\">Move <i>forward</i></span> to see where the passage leads<br>or <span class=\"colgreen\">turn <i>left</i></span> or <span class=\"colgreen\"><i>right</i></span> to see around either bend...";
  TheCells[12][4] = "";

  TheCells[13][0] = 4;
  TheCells[13][1] = "n";
  TheCells[13][2] = 0;
  TheCells[13][3] = "<i>Lovely Hedge!</i><br>All you can do is <span class=\"colgreen\">turn <i>left</i></span> or <span class=\"colgreen\">turn <i>right</i></span>.";
  TheCells[13][4] = "";

  TheCells[14][0] = 1;
  TheCells[14][1] = "c";
  TheCells[14][2] = 0;
  TheCells[14][3] = "<i>Congratulations! You have found your way to the heart of the famous Dodo Towers maze!</i><br>You can <span class=\"colred\">click the icon on the right</span> to read the Challenge Plaque <br>or <span class=\"colgreen\">turn <i>left</i></span> or <span class=\"colgreen\">turn <i>right</i></span>";
  TheCells[14][4] = "You must have already tried to solve this riddle - now, it is mysteriously empty...<br>All you can do is <span class=\"colgreen\">turn <i>left</i></span> or <span class=\"colgreen\">turn <i>right</i></span>.";

  TheCells[15][0] = 1;   // entrance
  TheCells[15][1] = "c";
  TheCells[15][2] = 0;
  TheCells[15][3] = "";
  TheCells[15][4] = "";

  TheCells[16][0] = 1;  // exit
  TheCells[16][1] = "e";
  TheCells[16][2] = 0;
  TheCells[16][3] = "<span class=\"colred\"><i>Warning</i> - you are about to leave the maze!</span><br>If you wish to stay in the maze, <span class=\"colgreen\">turn <i>left</i></span> or <span class=\"colgreen\"><i>right</i></span> to continue exploring.";
  TheCells[16][4] = "";
}

// ---------------------------------------------------------------------------
function createmaze()
{
  setmazeplayerdata();
  setcelldata();
  setchallengecells();
  setrandomsmapcells();
  setcatacombs();
      
  var c;
  for(c=0; c<MAZE_WIDTH*MAZE_HEIGHT; c++)
  {
    TheMaze[c] = new Array(4);    
  }

  // N=0, E=1, S=2, W=3
  // Data: 2char for file id, 'x' for no move, 'o' for move
  TheMaze[0][0] = "07x";
  TheMaze[0][1] = "08o";
  TheMaze[0][2] = "06x";
  TheMaze[0][3] = "01x";

  TheMaze[1][0] = "13x";
  TheMaze[1][1] = "10o";
  TheMaze[1][2] = "12o";
  TheMaze[1][3] = "09o";

  TheMaze[2][0] = "13x";
  TheMaze[2][1] = "08o";
  TheMaze[2][2] = "13x";
  TheMaze[2][3] = "08o";

  TheMaze[3][0] = "13x";
  TheMaze[3][1] = "08o";
  TheMaze[3][2] = "13x";
  TheMaze[3][3] = "08o";

  TheMaze[4][0] = "06x";
  TheMaze[4][1] = "07x";
  TheMaze[4][2] = "10o";
  TheMaze[4][3] = "09o";

  TheMaze[5][0] = "07x";
  TheMaze[5][1] = "10o";
  TheMaze[5][2] = "09o";
  TheMaze[5][3] = "06x";

  TheMaze[6][0] = "02x";
  TheMaze[6][1] = "03x";
  TheMaze[6][2] = "08o";
  TheMaze[6][3] = "09o";

  TheMaze[7][0] = "07x";
  TheMaze[7][1] = "08o";
  TheMaze[7][2] = "06x";
  TheMaze[7][3] = "01x";

  TheMaze[8][0] = "12o";
  TheMaze[8][1] = "12o";
  TheMaze[8][2] = "12o";
  TheMaze[8][3] = "12o";

  TheMaze[9][0] = "13x";
  TheMaze[9][1] = "08o";
  TheMaze[9][2] = "13x";
  TheMaze[9][3] = "08o";

  TheMaze[10][0] = "06x";
  TheMaze[10][1] = "07x";
  TheMaze[10][2] = "10o";
  TheMaze[10][3] = "08o";

  TheMaze[11][0] = "08o";
  TheMaze[11][1] = "07x";
  TheMaze[11][2] = "08o";
  TheMaze[11][3] = "13x";

  TheMaze[12][0] = "08o";
  TheMaze[12][1] = "13x";
  TheMaze[12][2] = "08o";
  TheMaze[12][3] = "13x";

  TheMaze[13][0] = "08o";
  TheMaze[13][1] = "13x";
  TheMaze[13][2] = "08o";
  TheMaze[13][3] = "13x";

  TheMaze[14][0] = "07x";
  TheMaze[14][1] = "08o";
  TheMaze[14][2] = "06x";
  TheMaze[14][3] = "01x";

  TheMaze[15][0] = "12o";
  TheMaze[15][1] = "09o";
  TheMaze[15][2] = "13x";
  TheMaze[15][3] = "10o";

  TheMaze[16][0] = "06x";
  TheMaze[16][1] = "07x";
  TheMaze[16][2] = "10o";
  TheMaze[16][3] = "09o";

  TheMaze[17][0] = "08o";
  TheMaze[17][1] = "06x";
  TheMaze[17][2] = "01x";
  TheMaze[17][3] = "07x";

  TheMaze[18][0] = "10o";
  TheMaze[18][1] = "09o";
  TheMaze[18][2] = "06x";
  TheMaze[18][3] = "07x";

//  TheMaze[19][0] = "09o";
//  TheMaze[19][1] = "06x";
//  TheMaze[19][2] = "07x";
//  TheMaze[19][3] = "10o";

  TheMaze[19][0] = "09o";
  TheMaze[19][1] = "13x";
  TheMaze[19][2] = "10o";
  TheMaze[19][3] = "12o";

  TheMaze[20][0] = "08o";
  TheMaze[20][1] = "13x";
  TheMaze[20][2] = "08o";
  TheMaze[20][3] = "13x";

  TheMaze[21][0] = "07x";
  TheMaze[21][1] = "10o";
  TheMaze[21][2] = "09o";
  TheMaze[21][3] = "06x";

  TheMaze[22][0] = "13x";
  TheMaze[22][1] = "10o";
  TheMaze[22][2] = "12o";
  TheMaze[22][3] = "09o";

  TheMaze[23][0] = "09o";
  TheMaze[23][1] = "06x";
  TheMaze[23][2] = "07x";
  TheMaze[23][3] = "10o";

  TheMaze[24][0] = "14x";
  TheMaze[24][1] = "07o";
  TheMaze[24][2] = "08o";
  TheMaze[24][3] = "06x";

  TheMaze[25][0] = "07x";
  TheMaze[25][1] = "10o";
  TheMaze[25][2] = "09o";
  TheMaze[25][3] = "06x";

//  TheMaze[26][0] = "13x";
//  TheMaze[26][1] = "08o";
//  TheMaze[26][2] = "13x";
//  TheMaze[26][3] = "08o";

  TheMaze[26][0] = "12o";
  TheMaze[26][1] = "09o";
  TheMaze[26][2] = "13x";
  TheMaze[26][3] = "10o";

  TheMaze[27][0] = "09o";
  TheMaze[27][1] = "06x";
  TheMaze[27][2] = "07x";
  TheMaze[27][3] = "10o";

  TheMaze[28][0] = "08o";
  TheMaze[28][1] = "13x";
  TheMaze[28][2] = "08o";
  TheMaze[28][3] = "13x";

  TheMaze[29][0] = "08o";
  TheMaze[29][1] = "13x";
  TheMaze[29][2] = "08o";
  TheMaze[29][3] = "13x";

  TheMaze[30][0] = "07x";
  TheMaze[30][1] = "12o";
  TheMaze[30][2] = "06x";
  TheMaze[30][3] = "04x";

  TheMaze[31][0] = "09o";
  TheMaze[31][1] = "13x";
  TheMaze[31][2] = "10o";
  TheMaze[31][3] = "12o";

  TheMaze[32][0] = "10o";
  TheMaze[32][1] = "12o";
  TheMaze[32][2] = "09o";
  TheMaze[32][3] = "13x";

  TheMaze[33][0] = "13x";
  TheMaze[33][1] = "08o";
  TheMaze[33][2] = "13x";
  TheMaze[33][3] = "08o";

  TheMaze[34][0] = "06x";
  TheMaze[34][1] = "07x";
  TheMaze[34][2] = "10o";
  TheMaze[34][3] = "09o";

//  TheMaze[35][0] = "08o";
//  TheMaze[35][1] = "13x";
//  TheMaze[35][2] = "08o";
//  TheMaze[35][3] = "13x";

  TheMaze[35][0] = "10o";
  TheMaze[35][1] = "12o";
  TheMaze[35][2] = "09o";
  TheMaze[35][3] = "13x";

//  TheMaze[36][0] = "10o";
//  TheMaze[36][1] = "09o";
//  TheMaze[36][2] = "06x";
//  TheMaze[36][3] = "07x";

  TheMaze[36][0] = "12o";
  TheMaze[36][1] = "09o";
  TheMaze[36][2] = "13x";
  TheMaze[36][3] = "10o";

  TheMaze[37][0] = "06x";
  TheMaze[37][1] = "07x";
  TheMaze[37][2] = "10o";
  TheMaze[37][3] = "09o";

  TheMaze[38][0] = "08o";
  TheMaze[38][1] = "08o";
  TheMaze[38][2] = "06x";
  TheMaze[38][3] = "07x";

  TheMaze[39][0] = "12o";
  TheMaze[39][1] = "09o";
  TheMaze[39][2] = "13x";
  TheMaze[39][3] = "10o";

  TheMaze[40][0] = "06x";
  TheMaze[40][1] = "01x";
  TheMaze[40][2] = "07x";
  TheMaze[40][3] = "08o";

  TheMaze[41][0] = "08o";
  TheMaze[41][1] = "13x";
  TheMaze[41][2] = "08o";
  TheMaze[41][3] = "13x";

  TheMaze[42][0] = "10o";
  TheMaze[42][1] = "09o";
  TheMaze[42][2] = "06x";
  TheMaze[42][3] = "07x";

  TheMaze[43][0] = "06x";
  TheMaze[43][1] = "01x";
  TheMaze[43][2] = "07x";
  TheMaze[43][3] = "08o";

  TheMaze[44][0] = "10o";
  TheMaze[44][1] = "09o";
  TheMaze[44][2] = "06x";
  TheMaze[44][3] = "07x";

  TheMaze[45][0] = "13x";
  TheMaze[45][1] = "10o";
  TheMaze[45][2] = "16e"; //exit!
  TheMaze[45][3] = "09o";

  TheMaze[46][0] = "06x";
  TheMaze[46][1] = "01x";
  TheMaze[46][2] = "07x";
  TheMaze[46][3] = "08o";

  TheMaze[47][0] = "07x";
  TheMaze[47][1] = "08o";
  TheMaze[47][2] = "06x";
  TheMaze[47][3] = "01x";

  TheMaze[48][0] = "09o";
  TheMaze[48][1] = "06x";
  TheMaze[48][2] = "07x";
  TheMaze[48][3] = "10o";

  // CRIPES!!!

  setteapot();
  setteapotplayer();
  sethelpertext();
}

// ---------------------------------------------------------------------------