diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/chain.apl | 8 | ||||
-rw-r--r-- | tests/queens.apl | 5 |
2 files changed, 12 insertions, 1 deletions
diff --git a/tests/chain.apl b/tests/chain.apl new file mode 100644 index 0000000..c8efeb7 --- /dev/null +++ b/tests/chain.apl @@ -0,0 +1,8 @@ +worker←{ + msg←{1}⍇0 + ⎕←'Worker id ',(⍕⎕self),' got message: ',(⍕msg),' forwarding to ',⍕⍵ + ⍵≡⍬: ⎕←'DONE' + msg⍈⍵ +} +last←worker&⍣25⊢⍬ +_←'Hello there'⍈last diff --git a/tests/queens.apl b/tests/queens.apl index a2ce041..d372186 100644 --- a/tests/queens.apl +++ b/tests/queens.apl @@ -4,4 +4,7 @@ subs←{(⊂⍵)⍪¨(⍳⍴⊃⍺)~atk ⍵} accm←{⍺⍪((⍴⍵)=⍴⊃⍺)↑⊂⍵} fmt←{(⊂⎕io+⍵=⌾⍳⍴⍵)⌷'∘⎕'} queens←{fmt¨ 1↓(↓1 ⍵⍴0)accm dfs subs ⍬} -⎕←queens 5 +eightqueens←queens 8 +⎕←'Number of solutions to 8 queens: ',⍕≢eightqueens +⎕←'First five:' +⎕←5↑eightqueens
\ No newline at end of file |