Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Amb/J/amb-1.j
Normal file
13
Task/Amb/J/amb-1.j
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
ambsel=: <^:99@,
|
||||
|
||||
ambassert=: {{
|
||||
anames=. (#~ 99<:{{L.do y}}@>) (#~ 0=nc)/:~~.;:m
|
||||
limit=. */alimits=. #@> avalues=. {{>^:98 do y}}every anames
|
||||
j=. 0 while. do.
|
||||
(anames)=. test=. (alimits#:j) {each avalues
|
||||
try. do m
|
||||
anames {{(x)=:y}}&> test break.
|
||||
catch. end.
|
||||
if. limit<:j=.j+1 do. assert.'no valid solution' end.
|
||||
end. EMPTY
|
||||
}}
|
||||
10
Task/Amb/J/amb-2.j
Normal file
10
Task/Amb/J/amb-2.j
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
s1=: ambsel;:'the that a'
|
||||
s2=: ambsel;:'frog elephant thing'
|
||||
s3=: ambsel;:'walked treaded grows'
|
||||
s4=: ambsel;:'slowly quickly'
|
||||
edgematch=: {{ x,y assert. ({:;x)={.;y }}
|
||||
{{)n edgematch/ s1,s2,s3,s4 }} ambassert
|
||||
echo s1,s2,s3,s4
|
||||
┌────┬─────┬─────┬──────┐
|
||||
│that│thing│grows│slowly│
|
||||
└────┴─────┴─────┴──────┘
|
||||
Loading…
Add table
Add a link
Reference in a new issue