浏览代码

week5 done

master
Thorn Avery 4 年前
父节点
当前提交
016dc8728d
共有 1 个文件被更改,包括 18 次插入6 次删除
  1. +18
    -6
      week5/morse.hoon

+ 18
- 6
week5/morse.hoon 查看文件

@@ -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' '.-'


正在加载...
取消
保存