@@ -0,0 +1,1600 @@
+package wumpus;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Iterator;%0Aimport java.util.NoSuchElementException;%0A%0Aimport wumpus.Environment.*;%0A%0A/**%0A * The iteration of plays that the player can take until reaches its end.%0A */%0Apublic class Runner implements Iterable%3CPlayer%3E, Iterator%3CPlayer%3E %7B%0A    private static final int DEFAULT_MAX_ITERATIONS = 200;%0A%0A    private final World world;%0A    private int iterations = 0;%0A%0A    /**%0A     * The runner constructor.%0A     * @param world The world instance.%0A     */%0A    public Runner(World world) %7B%0A        this.world = world;%0A    %7D%0A%0A    /**%0A     * Returns the iterator that can be user in a loop.%0A     * @return Itself%0A     */%0A    public Iterator%3CPlayer%3E iterator() %7B%0A        return this;%0A    %7D%0A%0A    /**%0A     * Check if the game has ended.%0A     * @return%0A     */%0A    public boolean hasNext() %7B%0A        Player player = world.getPlayer();%0A        return iterations %3C DEFAULT_MAX_ITERATIONS &&%0A                player.isAlive() && player.getResult() == Result.WIN;%0A    %7D%0A%0A    /**%0A     * Get player instance to calculate the next iteration.%0A     * @return The current player instance%0A     */%0A    public Player next() %7B%0A        if (!hasNext()) throw new NoSuchElementException();%0A        iterations++;%0A        return world.getPlayer();%0A    %7D%0A%0A    /**%0A     * Operation not supported, throws an error.%0A     */%0A    public void remove() %7B%0A        throw new UnsupportedOperationException();%0A    %7D%0A%0A    /**%0A     * Get how many iterations have been made so far.%0A     * @return The amount of iterations%0A     */%0A    public int getDepth() %7B%0A        return iterations;%0A    %7D%0A%7D%0A

Add a class to iterates plays until the game reachs its end