return GRID.length;
function countColumns() {
return GRID[0].length;
function gridSize() {
function totalCells() {
function convertColumn(coordinate) {
var index = 0;
function lightCell(coordinate) {
convertRow = parseInt(coordinate.charAt(1)) - 1;
else {
return false;
function isRock(coordinate) {
if (lightCell(coordinate) == "^")
{return true;}
function isCurrent(coordinate) {
if (lightCell(coordinate) == "~")
{return true;}
else {false;}
function isShip(coordinate) {
if (lightCell(coordinate) == "v") {
return true;}
else {
return false;
}
}
function lightRow(row) {
// Takes in the number of the row and returns its contents in an array.
return GRID[row-1];
function lightColumn(coordinate){
// Takes in the letter of the column and returns an array with the contents of the column.
col.push(GRID[row][convertColumn(coordinate)]);
return col;
rowNum = rowIndex + 1;