function onBoardReady(){
        var piece;

        piece = {
            id: 1,
            type: BATTLESHIP.CARRIER,
            orientation: 1, // 1: horizontal 0: vertical
            pos: [0, 0]
        };
        boardController.addPiece(piece);
       
        piece = {
            id : 2,
            type: BATTLESHIP.BATTLESHIP,
            orientation: 1,  // 1: horizontal 0: vertical
            pos: [0, 2]
        };
        boardController.addPiece(piece);

        piece = {
            id: 3,
            type: BATTLESHIP.CRUISER,
            orientation: 1, // 1: horizontal 0: vertical
            pos: [0, 4]
        };
        boardController.addPiece(piece);

        piece = {
            id : 4,
            type: BATTLESHIP.DESTROYER,
            orientation: 1, // 1: horizontal 0: vertical
            pos: [0, 6]
        };
        boardController.addPiece(piece);

        piece = {
            id : 5,
            type: BATTLESHIP.DESTROYER,
            orientation: 1, // 1: horizontal 0: vertical
            pos: [3, 6]
        };
        boardController.addPiece(piece);

        piece = {
            id : 6,
            type: BATTLESHIP.SUBMARINE,
            orientation: 1, // 1: horizontal 0: vertical
            pos: [0, 8]
        };
        boardController.addPiece(piece);

        piece = {
            id : 7,
            type: BATTLESHIP.SUBMARINE,
            orientation: 1, // 1: horizontal 0: vertical
            pos: [2, 8]
        };
        boardController.addPiece(piece);

    }
/**
     * Create objects for the board.
     */
Create objects for the board.
Create objects for the board .
function onBoardReady(){
        var piece;
        piece = {
            id: 1,
            type: BATTLESHIP.CARRIER,
            orientation: 1, 
            pos: [0, 0]
        };
        boardController.addPiece(piece);
        piece = {
            id : 2,
            type: BATTLESHIP.BATTLESHIP,
            orientation: 1,  
            pos: [0, 2]
        };
        boardController.addPiece(piece);
        piece = {
            id: 3,
            type: BATTLESHIP.CRUISER,
            orientation: 1, 
            pos: [0, 4]
        };
        boardController.addPiece(piece);
        piece = {
            id : 4,
            type: BATTLESHIP.DESTROYER,
            orientation: 1, 
            pos: [0, 6]
        };
        boardController.addPiece(piece);
        piece = {
            id : 5,
            type: BATTLESHIP.DESTROYER,
            orientation: 1, 
            pos: [3, 6]
        };
        boardController.addPiece(piece);
        piece = {
            id : 6,
            type: BATTLESHIP.SUBMARINE,
            orientation: 1, 
            pos: [0, 8]
        };
        boardController.addPiece(piece);
        piece = {
            id : 7,
            type: BATTLESHIP.SUBMARINE,
            orientation: 1, 
            pos: [2, 8]
        };
        boardController.addPiece(piece);
    }
function onBoardReady ( ) { var piece ; piece = { id : 1 , type : BATTLESHIP . CARRIER , orientation : 1 , pos : [ 0 , 0 ] } ; boardController . addPiece ( piece ) ; piece = { id : 2 , type : BATTLESHIP . BATTLESHIP , orientation : 1 , pos : [ 0 , 2 ] } ; boardController . addPiece ( piece ) ; piece = { id : 3 , type : BATTLESHIP . CRUISER , orientation : 1 , pos : [ 0 , 4 ] } ; boardController . addPiece ( piece ) ; piece = { id : 4 , type : BATTLESHIP . DESTROYER , orientation : 1 , pos : [ 0 , 6 ] } ; boardController . addPiece ( piece ) ; piece = { id : 5 , type : BATTLESHIP . DESTROYER , orientation : 1 , pos : [ 3 , 6 ] } ; boardController . addPiece ( piece ) ; piece = { id : 6 , type : BATTLESHIP . SUBMARINE , orientation : 1 , pos : [ 0 , 8 ] } ; boardController . addPiece ( piece ) ; piece = { id : 7 , type : BATTLESHIP . SUBMARINE , orientation : 1 , pos : [ 2 , 8 ] } ; boardController . addPiece ( piece ) ; }
Create objects for the board.
Create objects for the board .
// 1: horizontal 0: vertical // 1: horizontal 0: vertical // 1: horizontal 0: vertical // 1: horizontal 0: vertical // 1: horizontal 0: vertical // 1: horizontal 0: vertical // 1: horizontal 0: vertical