User Tools

Site Tools


mazewalker

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Last revisionBoth sides next revision
mazewalker [2022/09/05 12:00] – [After] frchrismazewalker [2022/09/05 12:22] – [Running your MazeWaker with Student Mazes] frchris
Line 60: Line 60:
  
 Download the text file you find at [[https://www.mathorama.com/karel/maze/]] and put it in the same folder as the project that has your MazeWalker.java.  Change the name of the file in the Runner file: Download the text file you find at [[https://www.mathorama.com/karel/maze/]] and put it in the same folder as the project that has your MazeWalker.java.  Change the name of the file in the Runner file:
 +<code MazeWalkerRunner.java>
 +import java.awt.Color;
 +import kareltherobot.*;
 +public class MazeWalkerRunner implements Directions
 +{
 +    public static void task()
 +    {
 +        // change the location to where the first beeper is:
 +        MazeWalker mayzie = new MazeWalker(1,1,North,0);  
 +        mayzie.pickBeeper(); // pick up the first beeper
 +        mayzie.escapeMaze();
 +        mayzie.turnOff();
 +    }
  
 +    public static void main(String[] args)
 +    {
 +        World.reset();
 +        World.setDelay(1);
 +        World.setBeeperColor(Color.RED);
 +        // change the name to match the maze world file
 +        World.readWorld("BobS.txt"); 
 +        World.setVisible();
 +        task();
 +    }
 +}
 +</code>
  
 +===== MaveWalker Troubleshooting =====
 Hints: Hints:
   * Case One check: is the front clear?   * Case One check: is the front clear?
mazewalker.txt · Last modified: 2022/09/05 12:25 by frchris

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki