Skip to content

Commit 2a9a7ed

Browse files
committed
complete the change of reducing the description to the function PRINT-AS-ROMAN
1 parent 81fb13c commit 2a9a7ed

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

kata-roman-mumerals.lisp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525
"prints the integer as a roman number"
2626
(check-type n (integer 1 3000))
2727
(loop while (plusp n) do
28-
(destructuring-bind (r d s p)
28+
(destructuring-bind (r d s)
2929
(find-descriptor n)
30-
(declare (ignore s))
31-
(when (and (< n d) p)
32-
(write p)
33-
(incf n (roman-digit-to-decimal-value p)))
30+
(let ((p (- d s)))
31+
(when (and (< n d) (plusp p))
32+
(write (first (find-descriptor p)))
33+
(incf n p)))
3434
(write r)
3535
(decf n d))))
3636

0 commit comments

Comments
 (0)