
Improvements: * `next`ing through a loop works correctly (when not already within a loop) * `next`ing out of a function works correctly Needs work: * `next`ing in a loop can be improved when starting within a loop
34 lines
317 B
Go
34 lines
317 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"time"
|
|
)
|
|
|
|
func sleepytime() {
|
|
time.Sleep(time.Millisecond)
|
|
}
|
|
|
|
func helloworld() {
|
|
fmt.Println("Hello, World!")
|
|
}
|
|
|
|
func testnext() {
|
|
j := 1
|
|
|
|
for i := 0; i <= 1; i++ {
|
|
j += j * (j ^ 3) / 100
|
|
|
|
helloworld()
|
|
}
|
|
|
|
helloworld()
|
|
}
|
|
|
|
func main() {
|
|
for {
|
|
sleepytime()
|
|
testnext()
|
|
}
|
|
}
|