June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
|
|
@ -0,0 +1,46 @@
|
|||
( encode
|
||||
= string symboltable
|
||||
. !arg:(?string.?symboltable)
|
||||
& vap
|
||||
$ ( (
|
||||
= A Z i
|
||||
. !symboltable:?A [?i !arg ?Z
|
||||
& !arg !A !Z:?symboltable
|
||||
& !i
|
||||
)
|
||||
. !string
|
||||
)
|
||||
)
|
||||
& ( decode
|
||||
= indices symboltable
|
||||
. !arg:(?indices.?symboltable)
|
||||
& str
|
||||
$ ( map
|
||||
$ ( (
|
||||
= A Z symbol
|
||||
. !symboltable:?A [!arg %?symbol ?Z
|
||||
& !symbol !A !Z:?symboltable
|
||||
& !symbol
|
||||
)
|
||||
. !indices
|
||||
)
|
||||
)
|
||||
)
|
||||
& ( test
|
||||
= string symboltable encoded decoded
|
||||
. !arg:(?string.?symboltable)
|
||||
& put$str$("input:" !string ", ")
|
||||
& encode$(!string.!symboltable):?encoded
|
||||
& put$("encoded:" !encoded ", ")
|
||||
& decode$(!encoded.!symboltable):?decoded
|
||||
& put$str$("decoded:" !decoded ", ")
|
||||
& ( !string:!decoded
|
||||
& out$OK
|
||||
| out$WRONG
|
||||
)
|
||||
)
|
||||
& a b c d e f g h i j k l m n o p q r s t y v w x y z
|
||||
: ?symboltable
|
||||
& test$(broood.!symboltable)
|
||||
& test$(bananaaa.!symboltable)
|
||||
& test$(hiphophiphop.!symboltable)
|
||||
Loading…
Add table
Add a link
Reference in a new issue