Name:
Anonymous
2009-08-16 23:08
Let us discuss the various implementations of theFIBONACCI BUTT SORT.
Name:
Anonymous
2009-08-17 19:06
This works in PLT scheme. It's not the best solution, but I wanted to use unfold.
[code](require srfi/1)
(define (make-cycle x)
(let ((clist (apply circular-list x)))
(lambda ()
(begin0
(car clist)
(set! clist (cdr clist))))))
(define bbcode-select
(let ((c (make-cycle (list o u))))
(lambda (x)
(if (string=? x " ")
" "
((c) x)))))
(define (buttsort x)
(b (i (apply string-append (unfold null? (lambda (y) (bbcode-select (car y))) cdr (regexp-split #rx"" x))))))[code]