Commit 7dbd7e8c authored by Antoine Martin's avatar Antoine Martin
Browse files

Finalize function to print list in three columns

parent d91273b6
......@@ -49,12 +49,18 @@
(1 (values (+ split 1) (+ split 1) (- split 1)))
(2 (values (+ split 1) (+ split 1) split)))))
(defun print-columns (l size)
(multiple-value-bind (lfirst lsecond)
(defun print-columns (l size file)
(multiple-value-bind (lfirst lsecond lthird)
(get-columns-length size)
(do ((n 0 (+ n 1))
(f l (cdr f))
(s (nthcdr lfirst l) (cdr s))
(th (nthcdr (+ lfirst lsecond) l) (cdr th)))
((= n lfirst) nil)
(format t "~a ~a ~a~%" (car f) (car s) (car th)))))
(if (>= n lthird)
(format file
(car f) (car s))
(format file
(car f) (car s) (car th))))))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment