Last active
March 24, 2019 19:00
-
-
Save shortsightedsid/1c7427b0e9f97810e8a1 to your computer and use it in GitHub Desktop.
Print Multiplication Tables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Print Multiplication Tables | |
;; | |
;; This demonstrates CL's format function and it's ability | |
;; to print out Roman Numerals, Numbers in Words etc.. | |
;; | |
;; Unlikely to be ever used! | |
(defun multiplication-table (number) | |
(loop for i from 1 below 12 | |
do (format t "~10<~@r~;times~> ~:d = ~r~%" i number (* i number)) | |
collect i into list-of-i | |
collect (* i number) into list-of-j | |
finally (return (values list-of-i list-of-j)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
An example: