Parcourir la source

week5 done

master
Thorn Avery il y a 4 ans
Parent
révision
016dc8728d
1 fichiers modifiés avec 18 ajouts et 6 suppressions
  1. +18
    -6
      week5/morse.hoon

+ 18
- 6
week5/morse.hoon Voir le fichier

@@ -1,14 +1,27 @@
:: the comment ":: code belongs here" indicates that one or more lines of code are needed to make this section of the program work.

|= raw=tape
=<
:: code belongs here
=. raw (cuss raw)
(convert raw)
|%
:: the latest and greatest rapper
|= l=@t
?|
&((gte l 'A') (lte l 'Z'))
&((gte l '0') (lte l '9'))
==
++ convert
:: code belongs here
:: (~(got by a) b) produces the value located at key b within map a
=/ chart ~(got by table)
:: code belongs here
|= m=tape
^- tape
%- zing
%+ turn m
|= l=@t
?: =(l ' ')
"[_]"
?: (mcelem l)
~[' ' (~(got by table) l) ' ']
~['[' l ']']
++ table
%- my
:~ :- 'A' '.-'


Chargement…
Annuler
Enregistrer