You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

50 lines
915 B

package main
import (
"f00860/kartograph-map-editor/pkg/generator"
"flag"
"fmt"
)
var (
format string
size int
wastelands int
mountains int
ruins int
filename string
)
func main() {
world := generator.New(size, wastelands, mountains, ruins)
switch format {
case "svg":
fmt.Print(world.SVG())
case "ascii":
fmt.Print(world.Plot())
case "json":
fmt.Print(world.JSON())
case "pdf":
world.PDF(filename)
case "web":
panic("Not implemented yet")
}
}
func init() {
flag.StringVar(&format, "format", "svg", "Output format (ascii, json, svg, pdf, web)")
flag.IntVar(&size, "size", 11, "The size of the map")
flag.IntVar(&wastelands, "wastelands", 7, "Number of wastelands")
flag.IntVar(&mountains, "mountains", 5, "Number of mountains")
flag.IntVar(&ruins, "ruins", 6, "Number of ruins")
flag.StringVar(&filename, "filename", "map.pdf", "The PDF filename")
flag.Parse()
}