advent-of-code/ranger/rangefunc.go

12 lines
165 B
Go
Raw Permalink Normal View History

2024-04-05 16:27:02 -06:00
package main
func countRF(n int) func(yield func(int) bool) {
return func(yield func(int) bool) {
for i := range n {
if !yield(i) {
return
}
}
}
}