make_a_maze
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
make_a_maze [2019/08/22 18:54] – frchris | make_a_maze [2021/09/05 13:14] – [3 Ways to Make Walls] frchris | ||
---|---|---|---|
Line 2: | Line 2: | ||
Make a Maze with 4 to 6 walls and one beeper. | Make a Maze with 4 to 6 walls and one beeper. | ||
- | You can post your .java file in [[https:// | + | You can post your .java file in GoogleClassroom. |
- | Make your plan and exchange it with another student. | + | Make your plan and exchange it with another student. |
Walls or obstacles are pared of the World class and can be placed in a NS or a EW direction, and have length. | Walls or obstacles are pared of the World class and can be placed in a NS or a EW direction, and have length. | ||
Line 14: | Line 14: | ||
====== 3 Ways to Make Walls ====== | ====== 3 Ways to Make Walls ====== | ||
- World.placeNSWall(), | - World.placeNSWall(), | ||
- | public class Maze implements Directions { | + | public class MyMaze |
- | public static void task() { | + | public static void task() { |
- | Robot robby = new Robot(1, | + | Robot robby = new Robot(1, |
- | robby.move(); | + | // Place the code to run the maze here |
- | robby.move(); | + | robby.turnOff(); |
- | robby.pickBeeper(); | + | |
- | robby.move(); | + | |
- | robby.turnLeft(); | + | |
- | robby.move(); | + | |
- | robby.move(); | + | |
- | robby.putBeeper(); | + | |
- | robby.move(); | + | |
- | robby.turnOff(); | + | |
- | } | + | |
- | // Main entry point | + | // Main entry point |
- | public static void main(String[] args) { | + | public static void main(String[] args) { |
- | World.setDelay(150); | + | World.setDelay(150); |
- | World.setSize(8, | + | World.setSize(8, |
- | World.placeBeepers(1, | + | // |
- | World.placeEWWall(3, 1, 3); | + | World.placeBeepers(6, |
- | World.placeNSWall(1, | + | |
- | World.placeEWWall(6, | + | // |
- | World.setVisible(); | + | |
- | task(); | + | World.placeNSWall(1, |
- | } | + | |
+ | World.placeNSWall(2, | ||
+ | World.placeNSWall(1, | ||
+ | World.placeEWWall(2, | ||
+ | World.placeNSWall(1, | ||
+ | | ||
+ | World.setVisible(); | ||
+ | task(); | ||
+ | } | ||
}</ | }</ | ||
- You can make a long string and send it all at once to the World. | - You can make a long string and send it all at once to the World. | ||
Line 59: | Line 59: | ||
northsouthwalls 1 6 5 | northsouthwalls 1 6 5 | ||
eastwestwalls 6 1 6</ | eastwestwalls 6 1 6</ | ||
+ | |||
+ | You can post world text file so others can run your maze with karel naming it (YourFirstName or Initials)Maze.txt - replacing (YourFirstName or initials) of course. | ||
+ | |||
+ | Note: Make sure your Maze has a solution, no islands, and that all locations are reachable. | ||
+ | |||
+ | ===== Make Maze Algorithm ===== | ||
+ | Try making this one, that was made by the java application [[|MakeMaze]] | ||
+ | {{:: | ||
+ | |||
+ | [[Try Running these Student Made Mazes]] |
make_a_maze.txt · Last modified: 2021/09/05 13:16 by frchris