Ternary logic: Difference between revisions
→{{header|langur}}
Langurmonkey (talk | contribs) |
Langurmonkey (talk | contribs) |
||
Line 3,467:
val .trSet = [false, null, true]
val .and = fn
case true, null:
case null, true:
case null: null
default: .a and .b
val .or = fn
case false, null:
case null, false:
case null: null
default: .a or .b
val .imply = fn
# formatting function for the result values
# replacing null with "maybe"
# using left alignment of 5 code points
val .F = fn
writeln "a not a"
for .a in .trSet {
writeln
}
Line 3,496:
for .a in .trSet {
for .b in .trSet {
writeln
}
}
Line 3,503:
for .a in .trSet {
for .b in .trSet {
writeln
}
}
Line 3,510:
for .a in .trSet {
for .b in .trSet {
writeln
}
}
Line 3,517:
for .a in .trSet {
for .b in .trSet {
writeln
}
}
|