Minecraft Maze Algorithm
迷宮路徑演算法 | Minecraft Education Edition | Left hand rule
Students can learn how to use python to build mazes and program the Agent to solve them.
Maze Algorithm makecode https://makecode.com/_PVT4186cwLmP Python Maze Generator Source: crux888
- https://makecode.com/_EeVEdMiTu5s0 Type maze 5 5 for a simple maze with 10 rows and 10 columns.
- If you can turn left, then turn left.
- If you can’t turn left but you can go straight ahead, then go straight ahead.
- If you can’t turn left or go straight ahead but you can turn right, then turn right.
- If you can’t turn left, go straight ahead, or turn right, then you must turn around.
0
-
Wow, lots of code to make mazes! Incredible! I had a hard time finding the subroutine for the code to move the agent through.
The algorithm is fun, but of course, you can always turn left, so you would go around and around in place. This makes the implementation interesting to me. Do you have it coded? (I want to try making that diamond maze! =] thanks for sharing!!!)
0 -
I would personaly use 'else if' statements for this algorithm.
0
Please sign in to leave a comment.
Comments
2 comments