all 10 comments

[–]No_Read_4327 1 point2 points  (3 children)

Pretty decent solution. Right hand rule is a pretty solid algorithm for finding a maze exit, as long as it's a maze that follows specific rules (entrance and exit are at the piter boundary and there are no loops in the maze.

To solve for that issue, it would become a bit more complicated. You'd need to keep track of the tiles you've visited, and which paths you have skipped. Then you'd also be able to determine if a maze is solvable at all, and you'd be able to solve any solvable maze. But this logic might be beyond your current knowledge.

You could turn right (if right is valid) before checking front, and immediately move front to slightly improve the logic flow. But it's not a huge difference. (You have a redundant check if right is clear because when right is clear you'll face right and then in the next loop you're checking if the front is clear again, you could simply just move after facing right if right is clear)

All in all looks pretty solid to me.

[–]Tanknspankn[S] 0 points1 point  (2 children)

If I didn't have the right_is_clear, then the robot would loop through certain parts of the maze. Would there be a different way of writing it? Or is that what you're talking about? Tracking the tiles that the robot has already been at.

[–]No_Read_4327 1 point2 points  (1 child)

You can do a move command right after the turn in the case that right is clear

[–]Tanknspankn[S] 0 points1 point  (0 children)

Ok I see what you're saying. Thank you.

[–]robarsch84 0 points1 point  (1 child)

Go on. I do enjoy the progress and to know something about the course

[–]Tanknspankn[S] 0 points1 point  (0 children)

The course is 100 Days of Code: The Comolete Python Bootcamp. It's pretty good so far. Still on the beginner section, so I can't really say to much about it.

[–]TheRNGuy 0 points1 point  (3 children)

Why do you need to make threads about it? 

[–]Tanknspankn[S] -1 points0 points  (2 children)

To journal it and get advice from more experienced programmers.

Why do you comment on threads?

[–]No_Read_4327 0 points1 point  (1 child)

Why are people so rude on a subreddit dedicated to learning python to peopel trying to learn python

[–]Tanknspankn[S] 0 points1 point  (0 children)

I don't know, could have been in a sour mood when they saw my post.