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

[Bug] Not working with non-square maze #1

Open
anhgelus opened this issue Jun 3, 2023 · 0 comments
Open

[Bug] Not working with non-square maze #1

anhgelus opened this issue Jun 3, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@anhgelus
Copy link
Member

anhgelus commented Jun 3, 2023

When we create a maze with -w != -h, there is two possibility:

If -w > -h

Throw an error like this:

panic: the wall with the id X have only 4 cells near

goroutine 1 [running]:
main.main()
        maze-generator-cli/main.go:44 +0x413
exit status 2

If -w < -h

panic: runtime error: index out of range [27] with length 25

goroutine 1 [running]:
github.com/msmp-core/maze-generator-cli/Generators.(*Maze).generateCells(0xc00006def0)
        maze-generator-cli/Generators/global.go:79 +0x65a
github.com/msmp-core/maze-generator-cli/Generators.NewRandomisedKruskal(0xc00001e159?)
        maze-generator-cli/Generators/randomised_kruskal.go:17 +0x17b
github.com/msmp-core/maze-generator-cli/Generators.GenerateNewMaze(...)
        maze-generator-cli/Generators/global.go:43
main.main()
        maze-generator-cli/main.go:42 +0x3a6
exit status 2
@anhgelus anhgelus added the bug Something isn't working label Jun 3, 2023
@anhgelus anhgelus self-assigned this Jun 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant