diff --git a/go/count/count b/go/count/count new file mode 100755 index 0000000..fc2b44e Binary files /dev/null and b/go/count/count differ diff --git a/go/count/doc.go b/go/count/doc.go new file mode 100644 index 0000000..26b54e5 --- /dev/null +++ b/go/count/doc.go @@ -0,0 +1,6 @@ +// count project doc.go + +/* +count document +*/ +package main diff --git a/go/count/main.go b/go/count/main.go new file mode 100644 index 0000000..388f56f --- /dev/null +++ b/go/count/main.go @@ -0,0 +1,29 @@ +// count project main.go +package main + +import ( + "fmt" +) + +func main() { + total := 0 + + fmt.Printf("First we want to print 1-100 with a for loop\n") + fmt.Printf("Then We will try to count down recursevly.") + for i := 0; i < 101; i++ { + fmt.Println(i) + total = i + } + recCount(total) + +} + +func recCount(seed int) { + fmt.Println(seed) + if seed == 0 { + return + } else { + recCount(seed - 1) + } + +}