Advertisement
Guest User

Untitled

a guest
Nov 21st, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. (define (convert-to-base-four num)
  2. (local
  3. ((define (convert lst x)
  4. (cond [(> 4 x) (append (cons x '()) lst)]
  5. [else (convert (append (cons (modulo x 4) '()) lst) (/ (- x (modulo x 4)) 4))]))
  6. )
  7. (convert '() num)
  8. )
  9. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement