Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code review #1

Open
gabikakol opened this issue Aug 20, 2022 · 4 comments
Open

code review #1

gabikakol opened this issue Aug 20, 2022 · 4 comments

Comments

@gabikakol
Copy link

Project version from 15th august at 10.47pm

As a first thing, sorry if I misunderstood something (especially comments throughout the code) because I just copied and pasted it into google translate.


General:

  • I think it’s cool that there’s a choice of 2 algorithms to solve the maze and user actually can choose which one wants to use
  • Great idea to measure time the execution takes, nicely shows how fast the algorithm is
  • I really like the idea of the Explore() class. Makes perfect sense to reuse those functions in both Tremaux and Wall Follower, and not just rewrite everything in each of those classes
  • I can’t visualize the maze since there is no src/data/maze.png path (I didn’t find any maze.png in the directory) – but I guess it’s for now and it just hasn’t been done yet, right?

Since I couldn’t visualize the created and solved maze by just running that code, I tested classes Tremaux and WallFollower by printing the output (solved maze) in the terminal – in both classes I added the function print_in_terminal()


Tremaux:

Maze printed in terminal: # - wall, . - path

terminal_print_tremaux

If the entrance is always in the left upper corner and exit in the right bottom corner, then the maze seems incorrect on the screenshot of the terminal attached above. There’s a wall at (0,0), meaning that the entrance is blocked. I put maze dimensions as 5 for the ease of illustrating it and I used self.solution which, from what I understood, should have listed coordinates of the cells of the solution path. Also, there are just areas of . and other areas of #, which doesn’t really look like a maze. I mean it might be solvable in theory (if the entrance and the exit are not blocked or we consider them to be at different coordinates) but I don’t think it should be done that way.


Wall follower:

terminal_print_wallFollower

There are the same issues – ie. the entrance is blocked with #, and there are the . and # areas instead of paths between the walls. Also when I print the coordinates from the self.solution, the last tuple always have the coordinates as float numbers whereas the rest of them are integers (see the output of print(self.solution) in the first line in the terminal). I don’t understand why that happens and what’s the point.


Other classes seem to be working :))

@JanneKarki
Copy link
Owner

Hi,

Thank you for your review! I think that the issue you are facing with the missing maze.png is due to some missing library. Do you have poetry installed on your computer and did you run the "poetry install"-command in the root directory before running the program? maze.png is created when maze is generated. App is quite ready now and should be working. Please let me know if poetry does not fix the issue. Thanks.

@gabikakol
Copy link
Author

Hey! Sorry for the late reply, I had a busy week. Poetry is installed and I still get FileNotFoundError: [Errno 2] No such file or directory: 'src/data/maze.png'

@JanneKarki
Copy link
Owner

Ok no problem, thanks for your help.

I did my solution (column, row) so that explains incorrect solutions that you got in your tests.

I need to check if I missed some depedencies from poetry because if I take clone from the repository it works fine after depedencies are installed. Just to make sure, did you run the "poetry install"-command in the root and then launched the app with "poetry run invoke start"-command?

@JanneKarki
Copy link
Owner

Btw, your finding about the errors in the solutions were beneficial. In the solution moves are (column, row), even algorithms handle them (row, column). Need to find out where it goes other way around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants