September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

6
Task/Amb/Jq/amb-1.jq Normal file
View file

@ -0,0 +1,6 @@
def amb: .[];
def joins:
(.[0][-1:]) as $left
| (.[1][0:1]) as $right
| if $left == $right then true else empty end;

8
Task/Amb/Jq/amb-2.jq Normal file
View file

@ -0,0 +1,8 @@
(["the","that","a"] | amb) as $word1
| (["frog","elephant","thing"] | amb) as $word2
| [$word1, $word2] | joins
| (["walked","treaded","grows"] | amb) as $word3
| [$word2, $word3] | joins
| (["slowly","quickly"] | amb) as $word4
| [$word3, $word4] | joins
| [$word1, $word2, $word3, $word4]

7
Task/Amb/Jq/amb-3.jq Normal file
View file

@ -0,0 +1,7 @@
jq -n -f amb.jq
[
"that",
"thing",
"grows",
"slowly"
]

6
Task/Amb/Jq/amb-4.jq Normal file
View file

@ -0,0 +1,6 @@
def amb(condition): .[] | select(condition);
def joins:
(.[0][-1:]) as $left
| (.[1][0:1]) as $right
| $left == $right ;

5
Task/Amb/Jq/amb-5.jq Normal file
View file

@ -0,0 +1,5 @@
(["the","that","a"] | amb(true)) as $word1
| (["frog","elephant","thing"] | amb( [$word1, .] | joins)) as $word2
| (["walked","treaded","grows"] | amb( [$word2, .] | joins)) as $word3
| (["slowly","quickly"] | amb( [$word3, .] | joins)) as $word4
| [$word1, $word2,$word3, $word4]