projecteuler-go/projecteuler.go
2021-06-06 07:01:00 -05:00

32 lines
593 B
Go

package main
import (
"fmt"
"os"
"shillerben.com/gitlab/shillerben/projecteuler-go/pe26"
"shillerben.com/gitlab/shillerben/projecteuler-go/pe27"
"shillerben.com/gitlab/shillerben/projecteuler-go/pe28"
)
var solve_funcs = map[string]func([]string){
"26": pe26.Solve,
"27": pe27.Solve,
"28": pe28.Solve,
}
func main() {
if len(os.Args) < 2 {
fmt.Println("usage: projecteuler <problem number> <problem args>")
return
}
problem_number := os.Args[1]
var problem_args []string
if len(os.Args) > 2 {
problem_args = os.Args[2:]
}
solve_funcs[problem_number](problem_args)
}