[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.lisp

Re: Integer to Character conversion

William James

11/9/2015 6:46:00 PM

Harald Hanche-Olsen wrote:

> | Many months ago a co-worker and I were having a contest to see whose
> | programming language was bigger^H^H^H^H^H^H better. Someone had an
> | e-mail sig of binary numbers, e.g.:
> |
> | 01000001 01110101 01110100 00100000 01110110 ...
> |
> | The task was to convert this to ASCII to see what it said. He chose C
> | while I used Lisp. My solution was:
> |
> | [...]
>
> Now that you got the code-char thing sorted out, how about this
> solution:
>
> cl-user> (map 'string #'code-char (let ((*read-base* 2)) (read)))
> (01000001 01110101 01110100 00100000 01110110)
> "Aut v"

MatzLisp (Ruby):

'01000001 01110101 01110100 00100000 01110110'.
split.map{|s| s.to_i(2).chr}.join
===>"Aut v"

--
[H]e was prosecuted ... for "denying" the gas chambers and the six million
figure. In July 1998 a Swiss court sentenced him to 15 months imprisonment,
and to pay a large fine, because of his writings. Rather than serve the
sentence, in August 2000 Graf went into exile. In 2001 he married a Russian
historian in Moscow. www.revisionists.com/revisionists/graf.html