Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (def morse-table
- {\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 "--.." \space " " \, "--.--" \. ".-.-.-"}) ;Fuck spaces.
- (defn translate [s]
- (apply str (map (fn [letter] (morse-table letter)) s)))
- (defn main []
- (println (str "In morse: " (translate (read-line)))))
- (main)
Add Comment
Please, Sign In to add comment