Ternary logic: Difference between revisions
→{{header|Yabasic}}: Corregido error en el código
(Ternary logic en TrueBASIC) |
(→{{header|Yabasic}}: Corregido error en el código) |
||
Line 6,037:
tDontKnow = 1
tTrue = 2
sub not3(b)▼
return 2-b▼
end sub▼
sub and3(a,b)
end sub
sub or3(a,b)
end sub
sub eq3(a,b)
if a = tDontKnow or b = tDontKnow then
elsif a = b then
else
▲ return tTrue
end if
▲ return tFalse
end sub
sub xor3(a,b)
▲end sub
▲sub not3(b)
▲ return 2-b
end sub
sub shortName3$(i)
end sub
sub longName3$(i)
end sub
print "Nombres cortos y largos para valores logicos ternarios:"
for i = tFalse to tTrue
next i
print
Line 6,089 ⟶ 6,088:
print "x", " ", "=x", " ", "not(x)"
for i = tFalse to tTrue
next i
print
Line 6,096 ⟶ 6,095:
print "x"," ","y"," ","x AND y"," ","x OR y"," ","x EQ y"," ","x XOR y"
for a = tFalse to tTrue
next a
end
Line 6,108 ⟶ 6,107:
Igual que la entrada de Liberty BASIC.
</pre>
=={{header|Wren}}==
|