Added inverse-counting exercise
This commit is contained in:
parent
9e978f0bcf
commit
8be6890727
|
@ -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)
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
module inverse-counting
|
||||
|
||||
go 1.22.0
|
|
@ -0,0 +1,6 @@
|
|||
package main
|
||||
|
||||
func main() {
|
||||
go upwards()
|
||||
downwards()
|
||||
}
|
Loading…
Reference in New Issue