Skip to content

Instantly share code, notes, and snippets.

@fabienhinault
Created May 26, 2015 19:57
Show Gist options
  • Save fabienhinault/b7d07b3c784504e169ef to your computer and use it in GitHub Desktop.
Save fabienhinault/b7d07b3c784504e169ef to your computer and use it in GitHub Desktop.
mixed radix n-tuple generation
(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