public boolean hasMoves() {
        // Checking if a free slot exists (and thus another move can be made)
        if (hasFreeSlot()) {
            return true;
        }

        // Up/Down directions
        for (int x = 0; x < cols - 1; x++) {
            for (int y = 0; y < rows; y++) {
                if (Tile.canCombine(tiles[y][x + 1], tiles[y][x])) {
                    return true;
                }
            }
        }

        // Left/Right directions
        for (int y = 0; y < rows - 1; y++) {
            for (int x = 0; x < cols; x++) {
                if (Tile.canCombine(tiles[y + 1][x], tiles[y][x])) {
                    return true;
                }
            }
        }
        return false;
    }