Benutzer:Morther
Aus ProgrammingWiki
Wiki-Quelltext dieser Seite.
<language>Scheme</language>
<code id="50800c5e2b2bf">
(define hexar
(lambda (binär)
(define y (* (- (length binär) 4) 10))
(define x (/ binär y))
(cond [< y 1] 'fertig
[= x 0] ((list '0)hexar y)
[= x 1] ((list '1)hexar y)
[= x 2] ((list '2)hexar y)
[= x 3] ((list '3)hexar y)
[= x 4] ((list '4)hexar y)
[= x 5] ((list '5)hexar y)
[= x 6] ((list '6)hexar y)
[= x 7] ((list '7)hexar y)
[= x 8] ((list '8)hexar y)
[= x 9] ((list '9)hexar y)
[= x 10] ((list 'A)hexar y)
[= x 11] ((list 'B)hexar y)
[= x 12] ((list 'C)hexar y)
[= x 13] ((list 'D)hexar y)
[= x 14] ((list 'E)hexar y)
[= x 15] ((list 'F)hexar y))))
</code>
<run id="50800c749c5b4">
</run>