Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
37
Task/Logical-operations/NetRexx/logical-operations.netrexx
Normal file
37
Task/Logical-operations/NetRexx/logical-operations.netrexx
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
/* NetRexx */
|
||||
options replace format comments java crossref symbols binary
|
||||
|
||||
runSample(arg)
|
||||
return
|
||||
|
||||
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
method logicalOperation(xL = boolean, xR = boolean) public static
|
||||
say showBool(xL) 'AND' showBool(xR) '=' showBool(xL & xR) -- AND
|
||||
say showBool(xL) 'OR ' showBool(xR) '=' showBool(xL | xR) -- OR
|
||||
say showBool(xL) 'XOR' showBool(xR) '=' showBool(xL && xR) -- XOR
|
||||
say ' ' 'NOT' showBool(xL) '=' showBool(\xL) -- NOT
|
||||
say
|
||||
return
|
||||
|
||||
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
method showBool(bb = boolean) public static
|
||||
if bb then bt = 'true '
|
||||
else bt = 'false'
|
||||
return bt
|
||||
|
||||
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
method runSample(arg) private static
|
||||
TRUE_ = (1 == 1)
|
||||
FALSE_ = \TRUE_
|
||||
lpairs = [ -
|
||||
[TRUE_, TRUE_ ], -
|
||||
[TRUE_, FALSE_], -
|
||||
[FALSE_, TRUE_ ], -
|
||||
[FALSE_, FALSE_] -
|
||||
]
|
||||
loop lx = 0 to lpairs.length - 1
|
||||
lpair = lpairs[lx]
|
||||
--say showBool(lpair[0]) showBool(lpair[1])
|
||||
logicalOperation(lpair[0], lpair[1])
|
||||
end lx
|
||||
return
|
||||
Loading…
Add table
Add a link
Reference in a new issue