BuggleInc / PLM

Programmer's Learning Machine
http://people.irisa.fr/Martin.Quinson/Teaching/PLM/
Other
63 stars 40 forks source link

regression .. buggle direction .. (fix #329) #521

Open jmullee opened 5 years ago

jmullee commented 5 years ago
The logic is inverted.
For the Maze / Following-the-walls exo, the solution below won't work unless ignoreDirectionDifference() is called

patch: src/plm/universe/bugglequest/AbstractBuggle.java
public abstract class AbstractBuggle
 - private boolean dontIgnoreDirectionDifference = true;
 + private boolean dontIgnoreDirectionDifference = false;

-----8<----
public void run() {
    while(!isOverBaggle()) {
        if(isFacingWall())
            right();
        else {
            forward();
            left();
            }
        }
    pickupBaggle();
    //ignoreDirectionDifference();
    }
---->8----