Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
|
|
@ -0,0 +1,31 @@
|
|||
\ one-dimensional automaton
|
||||
|
||||
\ direct map of input state to output state:
|
||||
{
|
||||
" " : 32,
|
||||
" #" : 32,
|
||||
" # " : 32,
|
||||
" ##" : 35,
|
||||
"# " : 32,
|
||||
"# #" : 35,
|
||||
"## " : 35,
|
||||
"###" : 32,
|
||||
} var, lifemap
|
||||
|
||||
: transition \ s ix (r:s') -- (r:s')
|
||||
>r dup r@ n:1- 3 s:slice
|
||||
lifemap @ swap caseof
|
||||
r> swap r@ -rot s:! >r ;
|
||||
|
||||
\ run over 'state' and generate new state
|
||||
: gen \ s -- s'
|
||||
clone >r
|
||||
dup s:len 2 n:-
|
||||
' transition 1 rot loop
|
||||
drop r> ;
|
||||
|
||||
: life \ s -- s'
|
||||
dup . cr gen ;
|
||||
|
||||
" ### ## # # # # # " ' life 10 times
|
||||
bye
|
||||
Loading…
Add table
Add a link
Reference in a new issue