public void step() {
        steps++;

        Point pacManLoc = board.getPacManLocation();
        board.move(pacManLoc.x, pacManLoc.y, pacManDirection);


        // ... and now, on to the ghosts. We'll leave the actual AI work to a
        // separate method in any class implementing the AI interface, focusing
        // instead only on handling and applying that method to the ghosts here.


        // Changing the line below lets you use different AI classes.
        AI ai = new AStarAI();

        // Note: We want to give the human player a solid head start, so we
        // won't even move the AI until at least 15 steps in.

        if (steps >= 15) {

            // Loop through each space on the board:
            for (int x = 0; x < board.width(); x++) {
                for (int y = 0; y < board.height(); y++) {

                    // Check if the space is a ghost:
                    char thing = board.getThingAt(x, y);
                    if (thing == '8' || thing == '%') {
                        // Yup, ghost! Actually call the AI and perform the move:
                        ai.performMoveOnBoard(x, y, board);
                        // Note that the line above will actually replace the ghost
                        // character on the board with either "m" or "M",
                        // ("moved ghost")- this is to prevent the nested for-loop
                        // we're in from getting confused and picking up the same
                        // ghost twice.
                    }
                }
            }

            // Now we have a board with a bunch of ms and Ms. Let's change those back
            // to the usual 8s and %s, eh?
            for (int x = 0; x < board.width(); x++) {
                for (int y = 0; y < board.height(); y++) {
                    char thing = board.getThingAt(x, y);
                    if (thing == 'm') {
                        board.setThingAt(x, y, '8');
                    } else if (thing == 'M') {
                        board.setThingAt(x, y, '%');
                    }
                }
            }
        }
    }