function strike(objV, player, opPlayer) {
    const x = parseInt(
      prompt(
        `${objV[player].name} choose an X coordinate to strike ${objV[opPlayer].name}'s battleship (0-3).`
      )
    );
    const y = parseInt(
      prompt(
        `${objV[player].name} choose a Y coordinate to strike ${objV[opPlayer].name}'s battleship (0-3).`
      )
    );
    if (objV[opPlayer].gameBoard[x][y] == " 1 ") {
      alert(
        `Direct hit ${objV[player].name}! You sank ${
          objV[opPlayer].name
        }'s battleship. They have ${
          objV[opPlayer].shipCount - 1
        } battleships left`
      );
      objV[opPlayer].gameBoard[x][y] = " ! ";
      objV[opPlayer].shipCount--;
      return true
    } else if (
      objV[opPlayer].gameBoard[x][y] == " - " ||
      objV[opPlayer].gameBoard[x][y] == " ! "
    ) {
      alert(`That spot has already been hit!`);
      return false
    } else {
      alert(`You missed! ${objV[opPlayer].name}'s ships are evading you!`);
      objV[opPlayer].gameBoard[x][y] = " - ";
      return false
    } 
}
//3. create a strike function to pass coordinates through opponent grid
3. create a strike function to pass coordinates through opponent grid
3 . create a strike function to pass coordinates through opponent grid
function strike(objV, player, opPlayer) {
    const x = parseInt(
      prompt(
        `${objV[player].name} choose an X coordinate to strike ${objV[opPlayer].name}'s battleship (0-3).`
      )
    );
    const y = parseInt(
      prompt(
        `${objV[player].name} choose a Y coordinate to strike ${objV[opPlayer].name}'s battleship (0-3).`
      )
    );
    if (objV[opPlayer].gameBoard[x][y] == " 1 ") {
      alert(
        `Direct hit ${objV[player].name}! You sank ${
          objV[opPlayer].name
        }'s battleship. They have ${
          objV[opPlayer].shipCount - 1
        } battleships left`
      );
      objV[opPlayer].gameBoard[x][y] = " ! ";
      objV[opPlayer].shipCount--;
      return true
    } else if (
      objV[opPlayer].gameBoard[x][y] == " - " ||
      objV[opPlayer].gameBoard[x][y] == " ! "
    ) {
      alert(`That spot has already been hit!`);
      return false
    } else {
      alert(`You missed! ${objV[opPlayer].name}'s ships are evading you!`);
      objV[opPlayer].gameBoard[x][y] = " - ";
      return false
    } 
}
function strike ( objV , player , opPlayer ) { const x = parseInt ( prompt ( ` ${ objV [ player ] . name } ${ objV [ opPlayer ] . name } ` ) ) ; const y = parseInt ( prompt ( ` ${ objV [ player ] . name } ${ objV [ opPlayer ] . name } ` ) ) ; if ( objV [ opPlayer ] . gameBoard [ x ] [ y ] == " 1 " ) { alert ( ` ${ objV [ player ] . name } ${ objV [ opPlayer ] . name } ${ objV [ opPlayer ] . shipCount - 1 } ` ) ; objV [ opPlayer ] . gameBoard [ x ] [ y ] = " ! " ; objV [ opPlayer ] . shipCount -- ; return true } else if ( objV [ opPlayer ] . gameBoard [ x ] [ y ] == " - " || objV [ opPlayer ] . gameBoard [ x ] [ y ] == " ! " ) { alert ( ` ` ) ; return false } else { alert ( ` ${ objV [ opPlayer ] . name } ` ) ; objV [ opPlayer ] . gameBoard [ x ] [ y ] = " - " ; return false } }
3. create a strike function to pass coordinates through opponent grid
3 . create a strike function to pass coordinates through opponent grid