Example #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")
}
Example #2
0
func createMaze() *mazelib.Maze {
	ySize := viper.GetInt("height")
	xSize := viper.GetInt("width")
	return generators.DepthFirst(xSize, ySize, viper.GetString("bias"))
}