2015/01: Initial commit
This commit is contained in:
commit
a8f1a5ea12
1 changed files with 54 additions and 0 deletions
54
2015/day-01/main.fs
Normal file
54
2015/day-01/main.fs
Normal file
|
@ -0,0 +1,54 @@
|
|||
: parse-instructions ( ulen addr -- )
|
||||
0 >r
|
||||
0 u+do
|
||||
c@+
|
||||
dup 40 = if
|
||||
r> r> r>
|
||||
1 +
|
||||
>r >r >r
|
||||
then
|
||||
41 = if
|
||||
r> r> r>
|
||||
1 -
|
||||
>r >r >r
|
||||
then
|
||||
loop
|
||||
r> ;
|
||||
|
||||
s" (())"
|
||||
parse-instructions
|
||||
." return: " . cr drop
|
||||
|
||||
s" ()()"
|
||||
parse-instructions
|
||||
." return: " . cr drop
|
||||
|
||||
s" ((("
|
||||
parse-instructions
|
||||
." return: " . cr drop
|
||||
|
||||
s" (()(()("
|
||||
parse-instructions
|
||||
." return: " . cr drop
|
||||
|
||||
s" ))((((("
|
||||
parse-instructions
|
||||
." return: " . cr drop
|
||||
|
||||
s" ())"
|
||||
parse-instructions
|
||||
." return: " . cr drop
|
||||
|
||||
s" ))("
|
||||
parse-instructions
|
||||
." return: " . cr drop
|
||||
|
||||
s" )))"
|
||||
parse-instructions
|
||||
." return: " . cr drop
|
||||
|
||||
s" )())())"
|
||||
parse-instructions
|
||||
." return: " . cr drop
|
||||
|
||||
bye
|
Loading…
Reference in a new issue