[ prog / sol / mona ]

prog


Fizz Buzz using infinite streams

1 2018-10-28 03:38
(import (srfi srfi-41))    
(define fizzbuzz
  (stream-map
    (lambda (x y) (or x y)) 
    (stream-constant #f #f "fizz" #f "buzz" "fizz" #f #f "fizz" "buzz" #f "fizz" #f #f "fizzbuzz" )
    (stream-from 1)))

; print only the 100 first
(stream-for-each (lambda (x) (format  #t "~A\n" x)) (stream-take 100 fizzbuzz))
2 2020-03-11 17:45 *

And then the job interviewer screamed "get out! now!"

3 2023-10-28 23:31 *

lol

4


VIP:

do not edit these