26 lines
1015 B
Plaintext
26 lines
1015 B
Plaintext
(display "Please, enter the string in lower case bounded by \" sign: ")
|
|
(lfor
|
|
(list->ff '(
|
|
(#\a . ".-" ) (#\b . "-..." ) (#\c . "-.-." )
|
|
(#\d . "-.." ) (#\e . "." ) (#\f . "..-." )
|
|
(#\g . "--." ) (#\h . "...." ) (#\i . ".." )
|
|
(#\j . ".---" ) (#\k . "-.-" ) (#\l . ".-.." )
|
|
(#\m . "--" ) (#\n . "-." ) (#\o . "---" )
|
|
(#\p . ".--." ) (#\q . "--.-" ) (#\r . ".-." )
|
|
(#\s . "..." ) (#\t . "-" ) (#\u . "..-" )
|
|
(#\v . "...-" ) (#\w . ".--" ) (#\x . "-..-" )
|
|
(#\y . "-.--" ) (#\z . "--.." ) (#\1 . ".----")
|
|
(#\2 . "..---") (#\3 . "...--") (#\4 . "....-")
|
|
(#\5 . ".....") (#\6 . "-....") (#\7 . "--...")
|
|
(#\8 . "---..") (#\9 . "----.") (#\0 . "-----")
|
|
(#\space . " ") (#\. . " ")))
|
|
(str-iter (read))
|
|
(lambda (codes char)
|
|
(let ((out (getf codes char)))
|
|
(if out (display out)))
|
|
codes))
|
|
|
|
; ==> Please, enter the string in lower case bounded by " sign:
|
|
; <== "hello world"
|
|
; ==> ......-...-..--- .-----.-..-..-..
|