Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
5
Task/Logical-operations/Jq/logical-operations-1.jq
Normal file
5
Task/Logical-operations/Jq/logical-operations-1.jq
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
def logic(a; b):
|
||||
"\(a) and \(b) => \(a and b)",
|
||||
"\(a) or \(b) => \(a or b)",
|
||||
"\(a) | not => \(a | not)",
|
||||
"if \(a) then true else false end => \(if a then true else false end)" ;
|
||||
3
Task/Logical-operations/Jq/logical-operations-2.jq
Normal file
3
Task/Logical-operations/Jq/logical-operations-2.jq
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
(false, null, []) as $a
|
||||
| (false, null, {}) as $b
|
||||
| logic( $a; $b )
|
||||
37
Task/Logical-operations/Jq/logical-operations-3.jq
Normal file
37
Task/Logical-operations/Jq/logical-operations-3.jq
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
$ jq -n -r -f logical_operations.jq
|
||||
false and false => false
|
||||
false or false => false
|
||||
false | not => true
|
||||
if false then true else false end => false
|
||||
false and null => false
|
||||
false or null => false
|
||||
false | not => true
|
||||
if false then true else false end => false
|
||||
false and {} => false
|
||||
false or {} => true
|
||||
false | not => true
|
||||
if false then true else false end => false
|
||||
null and false => false
|
||||
null or false => false
|
||||
null | not => true
|
||||
if null then true else false end => false
|
||||
null and null => false
|
||||
null or null => false
|
||||
null | not => true
|
||||
if null then true else false end => false
|
||||
null and {} => false
|
||||
null or {} => true
|
||||
null | not => true
|
||||
if null then true else false end => false
|
||||
[] and false => false
|
||||
[] or false => true
|
||||
[] | not => false
|
||||
if [] then true else false end => true
|
||||
[] and null => false
|
||||
[] or null => true
|
||||
[] | not => false
|
||||
if [] then true else false end => true
|
||||
[] and {} => true
|
||||
[] or {} => true
|
||||
[] | not => false
|
||||
if [] then true else false end => true
|
||||
Loading…
Add table
Add a link
Reference in a new issue