Name:
Anonymous
2009-08-16 23:08
Let us discuss the various implementations of theFIBONACCI BUTT SORT.
Name:
Anonymous
2009-08-17 17:32
(defun write-tag (tag string)
(if (null tag)
""
(format nil "[~a]~a[/~a]" tag string tag)))
(defun bb-buttsort (s)
"FIBONACCI BUTTSORT"
(write-tag "i"
(write-tag "b"
(apply #'concatenate 'string
(loop for c across s
and parity = nil then (not parity)
collect (write-tag (if parity "o" "u") c))))))
(defun write-tag (tag string)
(if (null tag)
""
(format nil "[~a]~a[/~a]" tag string tag)))
(defun bb-buttsort (s)
(write-tag "i"
(write-tag "b"
(apply #'concatenate 'string
(loop for c across s
and parity = nil then (not parity)
collect (write-tag (if parity "o" "u") c))))))