$ cat yin-yang-puzzle.scm ;; The yin-yang puzzle ;; cf. https://en.wikipedia.org/wiki/Call-with-current-continuation ((lambda (yin) ((lambda (yang) (yin yang)) ((lambda (cc) (display '*) cc) (call/cc (lambda (c) c))))) ((lambda (cc) (newline) cc) (call/cc (lambda (c) c)))) ;; => \n*\n**\n***\n****\n*****\n******\n... $ little-scheme-in-go yin-yang-puzzle.scm | head * ** *** **** ***** ****** ******* ******** ********* $