function init() {
  fixLinks();

  var m = document.cookie.match(/players=([12])/);
  if (m && m[1] === '2') {
    playerOption = 2;
  }
  document.getElementById('players').selectedIndex = playerOption - 1;
  m = document.cookie.match(/difficulty=([012])/);
  DIFFICULTY = Number(m ? m[1] : 1);
  document.getElementById('difficulty').selectedIndex = DIFFICULTY;
  document.getElementById('difficulty').disabled = (playerOption === 2);
  registerOptions('players', 'difficulty');

  // Initialize the beard.
  var svg = document.getElementById('board');
  svg.addEventListener('click', onClick);
  svg.setAttribute('height', HEIGHT * CELL_SIZE + 1);
  svg.setAttribute('width', WIDTH * CELL_SIZE + 1);
  initSvgGrid();
  initSvgMatrix();
  newGame();

  document.addEventListener('keypress', keyPress);
  document.getElementById('start').addEventListener('click', startPress);
  showStart();
}
// On page load, initialize the event handlers.
On page load, initialize the event handlers.
On page load initialize the event handlers .
function init() {
  fixLinks();
  var m = document.cookie.match(/players=([12])/);
  if (m && m[1] === '2') {
    playerOption = 2;
  }
  document.getElementById('players').selectedIndex = playerOption - 1;
  m = document.cookie.match(/difficulty=([012])/);
  DIFFICULTY = Number(m ? m[1] : 1);
  document.getElementById('difficulty').selectedIndex = DIFFICULTY;
  document.getElementById('difficulty').disabled = (playerOption === 2);
  registerOptions('players', 'difficulty');
  var svg = document.getElementById('board');
  svg.addEventListener('click', onClick);
  svg.setAttribute('height', HEIGHT * CELL_SIZE + 1);
  svg.setAttribute('width', WIDTH * CELL_SIZE + 1);
  initSvgGrid();
  initSvgMatrix();
  newGame();
  document.addEventListener('keypress', keyPress);
  document.getElementById('start').addEventListener('click', startPress);
  showStart();
}
function init ( ) { fixLinks ( ) ; var m = document . cookie . match ( / players=([12]) / ) ; if ( m && m [ 1 ] === '2' ) { playerOption = 2 ; } document . getElementById ( 'players' ) . selectedIndex = playerOption - 1 ; m = document . cookie . match ( / difficulty=([012]) / ) ; DIFFICULTY = Number ( m ? m [ 1 ] : 1 ) ; document . getElementById ( 'difficulty' ) . selectedIndex = DIFFICULTY ; document . getElementById ( 'difficulty' ) . disabled = ( playerOption === 2 ) ; registerOptions ( 'players' , 'difficulty' ) ; var svg = document . getElementById ( 'board' ) ; svg . addEventListener ( 'click' , onClick ) ; svg . setAttribute ( 'height' , HEIGHT * CELL_SIZE + 1 ) ; svg . setAttribute ( 'width' , WIDTH * CELL_SIZE + 1 ) ; initSvgGrid ( ) ; initSvgMatrix ( ) ; newGame ( ) ; document . addEventListener ( 'keypress' , keyPress ) ; document . getElementById ( 'start' ) . addEventListener ( 'click' , startPress ) ; showStart ( ) ; }
On page load, initialize the event handlers.
On page load initialize the event handlers .
// Initialize the beard.