September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
25
Task/Morse-code/Ol/morse-code.ol
Normal file
25
Task/Morse-code/Ol/morse-code.ol
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
(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"
|
||||
; ==> ......-...-..--- .-----.-..-..-..
|
||||
Loading…
Add table
Add a link
Reference in a new issue