function placeCharacters(c, grid, max) {
    for (i = 0; i < max; i++) {
      const randX = Math.floor(Math.random() * max);
      const randY = Math.floor(Math.random() * max);
      if (grid[randX][randY] !== " 1 ") {
        grid[randX][randY] = ` ${c} `;
      }
    }
  }
//2. create a function to generate random coordinates for ships and place them as 1's on the grid
2. create a function to generate random coordinates for ships and place them as 1's on the grid
2 . create a function to generate random coordinates for ships and place them as 1 ' s on the grid
function placeCharacters(c, grid, max) {
    for (i = 0; i < max; i++) {
      const randX = Math.floor(Math.random() * max);
      const randY = Math.floor(Math.random() * max);
      if (grid[randX][randY] !== " 1 ") {
        grid[randX][randY] = ` ${c} `;
      }
    }
  }
function placeCharacters ( c , grid , max ) { for ( i = 0 ; i < max ; i ++ ) { const randX = Math . floor ( Math . random ( ) * max ) ; const randY = Math . floor ( Math . random ( ) * max ) ; if ( grid [ randX ] [ randY ] !== " 1 " ) { grid [ randX ] [ randY ] = ` ${ c } ` ; } } }
2. create a function to generate random coordinates for ships and place them as 1's on the grid
2 . create a function to generate random coordinates for ships and place them as 1 ' s on the grid