Created
February 24, 2015 20:56
-
-
Save alexispurslane/88cb8b4832c35f0b31f0 to your computer and use it in GitHub Desktop.
Gets the digits of a number by converting it to a string, then separating the strings characters, and converting them to numbers. I am using this for my CARDIAC computer emulator.
This file contains hidden or 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
| (define (get-digits n) | |
| (map string->number (map string (string->list (number->string n))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment