RosettaCodeData/Task/Logical-operations/Icon/logical-operations-2.icon

12 lines
322 B
Text
Raw Permalink Normal View History

2023-10-02 18:11:16 -07:00
(let pad (comp str (pad-right " " 10)))
(print "a b | (and a b) (or a b) (not a) (xor a b)")
(print (str* "-" 20) "+" (str* "-" 40))
(join "\n"
(for a [false :a]
b [false :b]
(... str (pad a) (pad b) "| "
(for op [and or not xor]
(pad (if (= op not) (op a) (op a b)))))))