public static boolean adjacentCoordinates(Coordinates c1, Coordinates c2, int height, int width) {

                // If they are in the same row
                if (c1.row == c2.row) {

                        // If they are one to the left or one to the right of
                        // each other
                        if ((c1.col + 1) % width == c2.col || (c2.col + 1) % width == c1.col) {
                                return true;
                        }

                }
                // If they are in the same column
                if (c1.col == c2.col) {

                        // If they are one above or below each other
                        if ((c1.row + 1) % height == c2.row || (c2.row + 1) % height == c1.row) {
                                return true;
                        }
                }

                return false;

        }