RosettaCodeData/Task/Logical-operations/Relation/logical-operations.relation

14 lines
233 B
Plaintext

program logic(x,y)
relation a, b, op, result
insert x, y, "and", x and y
insert x, y, "or", x or y
insert x, "", "not", not x
insert x, y, "xor", x xor y
print
end program
run logic(0,0)
run logic(0,1)
run logic(1,0)
run logic(1,1)