We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 81fb13c commit 2a9a7edCopy full SHA for 2a9a7ed
1 file changed
kata-roman-mumerals.lisp
@@ -25,12 +25,12 @@
25
"prints the integer as a roman number"
26
(check-type n (integer 1 3000))
27
(loop while (plusp n) do
28
- (destructuring-bind (r d s p)
+ (destructuring-bind (r d s)
29
(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)))
+ (let ((p (- d s)))
+ (when (and (< n d) (plusp p))
+ (write (first (find-descriptor p)))
+ (incf n p)))
34
(write r)
35
(decf n d))))
36
0 commit comments