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

Can you also add solutions? #4

Open
irineos1995 opened this issue Oct 16, 2020 · 7 comments
Open

Can you also add solutions? #4

irineos1995 opened this issue Oct 16, 2020 · 7 comments

Comments

@irineos1995
Copy link

Hello razimantv,
this is a great project, Love it!
Is there a chance you can provide SVG/png solutions to the maze create?
Like when you generate a maze, its corresponding solution is also generated?

Kind regards,
Eiri

@razimantv
Copy link
Owner

It should be possible. I haven't got around to doing it, I will be very happy if someone wants to take charge.

@Zvih
Copy link

Zvih commented Aug 17, 2022

@razimantv Hi there,
Is commit with solution was merged?

@Zvih
Copy link

Zvih commented Aug 17, 2022

Hello razimantv, this is a great project, Love it! Is there a chance you can provide SVG/png solutions to the maze create? Like when you generate a maze, its corresponding solution is also generated?

Kind regards, Eiri

Did you find solution?

@RasaKh
Copy link

RasaKh commented Sep 7, 2022

Since the code to generate the solution is there now could you please add the option to generate SVGs with/without solutions?

@m1tYo
Copy link

m1tYo commented Dec 5, 2022

Hello! Great project and congratulations on a job well done. I've got one question though (related to the last comment) - would it be possible to add the option to display solutions - I understand from your commit that there's an issue with that part, but I'd like to know if you plan to work on it.

@razimantv
Copy link
Owner

Sorry, been very busy. Need to tweak the code quite a bit to show solutions properly, it will take a while before I can get to that. Feel free to add a pull request if you can code it up before me.

@neocogent
Copy link

neocogent commented Mar 24, 2024

I had a crack at this - at least a basic approach as I don't fully understand how the code works for solving. I saw there was a solution_ variable and used that to svg print the edges that are in that solution. That was interesting.

I took this further and tried to svg print a path thru the edges but found they are not in sorted order to indicate a path so the path lines jumped all over. Then I took an approach of svg printing a marker on each edge to show a path thru the maze. That worked quite well for some maze types. But on hexogonal and circ-triangular the solution_ variable seems to have only a few edges so this only resulted in some marks near the center - not marking a useful path.

After this I decided to back away as I didn't know why this was the case. I am open to working more if this is a viable approach or perhaps some basic explanation about the solution and how that works for differing types.

My altered code prints a second file named <prefix>.key.svg to accompany the original <prefix>.svg maze output. I have saved samples of the solution svg outputs and have attached them here if anyone cares to view (as jpg to save space).

maze-circ key
maze-hex key
maze-hon key
maze-sqr key
maze-tri key

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

6 participants