title: Maze solving with python
body: <p>I am trying to make a maze solver, and it is working except that instead of the path being marked by "o" I want it to be marked with ">", "&lt;", "v", "^" depending on the direction of the path. This is the part of the code where it solves the maze: </p>
  
  <pre><code> def solve(self,x,y):
      maze = self.maze
  
      #Base case  
      if y &gt; len(maze) or x &gt; len(maze[y]):
          return False
  
      if maze[y][x] == "E":
          return True 
  
      if  maze[y][x] != " ":
          return False
  
  
      #marking
      maze[y][x] = "o"        
  
      #recursive case
      if self.solve(x+1,y) == True :  #right
          return True
      if self.solve(x,y+1) == True :  #down
          return True     
      if self.solve(x-1,y) == True :  #left
          return True     
      if self.solve(x,y-1) == True :  #up
          return True     
  
      #Backtracking
      maze[y][x] = " "
      return False    
  </code></pre>
  
  <p>This is an example of an unsolved maze:</p>
  
  <pre><code>####################################
  #S#  ##  ######## # #      #     # #
  # #   #             # #        #   #
  #   # ##### ## ###### # #######  # #
  ### # ##    ##      # # #     #### #
  #   #    #  #######   #   ###    #E#
  ####################################
  </code></pre>
  
  <p>And this is the solved version of the same maze using the code above:</p>
  
  <pre><code>####################################
  #S#  ##  ######## # #oooooo#  ooo# #
  #o#ooo#    oooo     #o#   ooooo#ooo#
  #ooo#o#####o##o######o# #######  #o#
  ### #o##oooo##oooooo#o# #     ####o#
  #   #oooo#  #######ooo#   ###    #E#
  ####################################
  </code></pre>
  
  <p>The result that I want to get to is: </p>
  
  <pre><code>####################################
  #S#  ##  ######## # #&gt;&gt;&gt;&gt;&gt;v#  ^&gt;v# #
  #v#^&gt;v#    &gt;&gt;&gt;v     #^#   &gt;&gt;&gt;&gt;^#&gt;&gt;v#
  #&gt;&gt;^#v#####^##v######^# #######  #v#
  ### #v##^&gt;&gt;^##&gt;&gt;&gt;&gt;&gt;v#^# #     ####v#
  #   #&gt;&gt;&gt;^#  #######&gt;&gt;^#   ###    #E#
  ####################################
  </code></pre>
  
  <p>How is it possible to do this?</p>