A Python maze game, let's challenge it!

Liam Xavier
0 replies
This is a list of strings representing a maze maze = [ "P#----", "-#-##-", "------", "-#-##-", "-#-#--", "---#-X",] In this maze: P represents the player. - represents an empty space where the player can stand. # represents a wall where the player cannot stand. X represents the goal. Reaching this goal means winning the game. Write a function that takes this maze as input and returns the shortest path from the player to the goal. The player can only move one step at a time and can move in four directions: up, down, left, and right.
🤔
No comments yet be the first to help