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