← Back to archive

Stdle #64 · iteration · 2026-08-09

What does this Go snippet output?

A past puzzle — fully playable. 4 attempts, hints on wrong guesses.

package main
import "fmt"
func main() {
count := 0
loop:
for i := 0; i < 5; i++ {
switch i {
case 3:
break loop
default:
count++
}
}
fmt.Println(count)
}
Iteration
4 attempts left

Answer & explanation