Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define (convert-to-base-four num)
- (local
- ((define (convert lst x)
- (cond [(> 4 x) (append (cons x '()) lst)]
- [else (convert (append (cons (modulo x 4) '()) lst) (/ (- x (modulo x 4)) 4))]))
- )
- (convert '() num)
- )
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement