exercism/go/pascals-triangle/pascal_printer.go
2016-08-13 18:20:14 -05:00

22 lines
336 B
Go

package main
import (
"fmt"
"os"
"strconv"
"gogs.bullercodeworks.com/brian/pascal"
)
func main() {
if len(os.Args) == 2 {
if num, err := strconv.Atoi(os.Args[1]); err == nil {
ret := pascal.Triangle(num)
for i := range ret {
fmt.Println(ret[i])
}
return
}
}
fmt.Println("Usage: ./pascal_printer <depth>")
}