diff --git a/inverse-counting/counters.go b/inverse-counting/counters.go new file mode 100644 index 0000000..bdcd88f --- /dev/null +++ b/inverse-counting/counters.go @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "time" +) + +func upwards() { + for i := 0; i < 100; i++ { + fmt.Println(i) + time.Sleep(time.Millisecond * 75) + } +} + +func downwards() { + for i := 100; i >= 0; i-- { + fmt.Println(i) + time.Sleep(time.Millisecond * 75) + } +} diff --git a/inverse-counting/go.mod b/inverse-counting/go.mod new file mode 100644 index 0000000..721385b --- /dev/null +++ b/inverse-counting/go.mod @@ -0,0 +1,3 @@ +module inverse-counting + +go 1.22.0 diff --git a/inverse-counting/main.go b/inverse-counting/main.go new file mode 100644 index 0000000..1e0ef18 --- /dev/null +++ b/inverse-counting/main.go @@ -0,0 +1,6 @@ +package main + +func main() { + go upwards() + downwards() +}