Skip to content

Commit

Permalink
feat(kruskal): base of the kruskal algorithm (not working)
Browse files Browse the repository at this point in the history
  • Loading branch information
anhgelus committed May 31, 2023
1 parent 59c045e commit b4e59f6
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Generators/randomised_kruskal.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package Generators

type kruskal struct {
*Maze
}

// NewRandomisedKruskal is a func generating a new maze with the Randomized Kruskal's Algorithm
func NewRandomisedKruskal(b *Maze) error {
m := kruskal{b}
m.firstWalls()
return nil
}

func (m *kruskal) firstWalls() {
m.HorizontalWalls = generateWalls(m.Width, m.Height, false)
m.VerticalWalls = generateWalls(m.Height, m.Width, true)
}

0 comments on commit b4e59f6

Please sign in to comment.