Created
May 26, 2015 19:57
-
-
Save fabienhinault/b7d07b3c784504e169ef to your computer and use it in GitHub Desktop.
mixed radix n-tuple generation
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 (1+ radixes a) | |
| (if (equal? (car a) (- (car radixes) 1)) | |
| (cons 0 (1+ (cdr radixes) (cdr a))) | |
| (cons (+ 1 (car a)) (cdr a)))) | |
| (define (gen radixes a) | |
| (displayln a) | |
| (gen radixes (1+ radixes a))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment