github.com/benhoyt/goawk@v1.8.1/testdata/p.48b (about) 1 BEGIN { k = 3; n = 10 } 2 { if (n <= 0) exit 3 if (rand() <= k/n) { print; k-- } 4 n-- 5 }