Anonymous user
Ternary logic: Difference between revisions
→{{header|Pascal}}: fix wrong logic and indentation
(→{{header|Pascal}}: Marked incorrect as the EQUAL table if it should be the equivalent table of the task description, is wrong) |
(→{{header|Pascal}}: fix wrong logic and indentation) |
||
Line 1,677:
=={{header|Pascal}}==
<lang pascal>Program TernaryLogic (output);
type
trit = (terTrue, terMayBe, terFalse);
function terNot (a: trit): trit;
begin
end;
function terAnd (a, b: trit): trit;
begin
terAnd := terFalse
end;
function terOr (a, b: trit): trit;
begin
terOr := terTrue
end;
function terEquals (a, b: trit): trit;
begin
terEquals := terMayBe;▼
▲ if a = b then
terEquals := terTrue
if (a = terMayBe) or (b = terMayBe) then
end;
function terIfThen (a, b: trit): trit;
begin
terIfThen := terTrue
end;
Line 1,735:
begin
case a of
end;
begin
Line 1,794 ⟶ 1,792:
EQUAL True Maybe False
True True
Maybe
False False
</pre>
|