RosettaCodeData/Task/Logical-operations/Nu/logical-operations.nu

4 lines
185 B
Text
Raw Permalink Normal View History

2023-12-16 21:33:55 -08:00
def ops [a b] {{A: $a, B: $b, "Not A": (not $a), OR: ($a or $b), AND: ($a and $b), XOR: ($a xor $b)}}
[true false] | each {[[true $in] [false $in]]} | flatten | each {ops $in.0 $in.1}