$(document).ready(function() {

});

@@ -24,13 +24,1164 @@
 ion() %7B%0A
+  var Game = function(givenBoard) %7B%0A%0A    function getRandomIndex(maxExclusive) %7B%0A      return Math.floor(Math.random() * maxExclusive)%0A    %7D%0A%0A    function randomBoard() %7B%0A      var board = %5B0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0%5D%0A      var index1 = getRandomIndex(16)%0A      var index2 = index1%0A%0A      do %7B%0A        index2 = getRandomIndex(16)%0A      %7D while (index2 === index1)%0A%0A      var startingNumbers = %5B2, 4%5D%0A%0A      var startingNum1 = startingNumbers%5BgetRandomIndex(2)%5D%0A      var startingNum2 = startingNumbers%5BgetRandomIndex(2)%5D%0A%0A      board%5Bindex1%5D = startingNum1%0A      board%5Bindex2%5D = startingNum2%0A      return board%0A    %7D%0A%0A    function presetBoard(board) %7B%0A      var boardArray = board.split(%22%22)%0A      for (i = 0; i %3C boardArray.length; i++) %7B%0A       boardArray%5Bi%5D = parseInt(boardArray%5Bi%5D)%0A      %7D%0A      return boardArray%0A    %7D%0A    %0A    if (givenBoard === undefined) %7B%0A      this.board = randomBoard()%0A    %7D else %7B%0A      this.board = presetBoard(givenBoard)%0A    %7D%0A  %7D%0A%0A  Game.prototype.boardify = function() %7B%0A    return %5B%0A      this.board.slice(0,4),%0A      this.board.slice(4,8),%0A      this.board.slice(8,12),%0A      this.board.slice(12,16)%0A    %5D%0A  %7D
 %0A%7D);%0A

Define game prototype, define board attribute, and created boardify prototype function