Beispiel #1
0
func idToGenerator() *mazelib.Maze {
	val := dom.GetWindow().Document().GetElementByID("generator").(*dom.HTMLSelectElement).Value
	switch val {
	case "dfs":
		return generators.DepthFirst(15, 10, "")
	case "dfs-h":
		return generators.DepthFirst(15, 10, "H")
	case "dfs-v":
		return generators.DepthFirst(15, 10, "V")
	case "dfs-x":
		return generators.DepthFirst(15, 10, "X")
	case "dfs-o":
		return generators.DepthFirst(15, 10, "O")
	case "empty":
		return mazelib.EmptyMaze(15, 10)
	}
	panic("unknown generator")
}
Beispiel #2
0
// Creates a maze without any walls
// Good starting point for additive algorithms
func EmptyMaze() *mazelib.Maze {
	ySize := viper.GetInt("height")
	xSize := viper.GetInt("width")
	return mazelib.EmptyMaze(xSize, ySize)
}