testFalse = 0 ' F testDoNotKnow = 1 ' ? testTrue = 2 ' T print "Short and long names for ternary logic values" for i = testFalse to testTrue print shortName3$(i);" ";longName3$(i) next i print print "Single parameter functions" print "x";" ";"=x";" ";"not(x)" for i = testFalse to testTrue print shortName3$(i);" ";shortName3$(i);" ";shortName3$(not3(i)) next print print "Double parameter fuctions" html "" for a = testFalse to testTrue for b = testFalse to testTrue html "" next next html "
xyx AND yx OR yx EQ yx XOR y
" html shortName3$(a); "";shortName3$(b); "" html shortName3$(and3(a,b));"";shortName3$(or3(a,b)); "" html shortName3$(eq3(a,b)); "";shortName3$(xor3(a,b));"
" function and3(a,b) and3 = min(a,b) end function function or3(a,b) or3 = max(a,b) end function function eq3(a,b) eq3 = testFalse if a = tDontKnow or b = tDontKnow then eq3 = tDontKnow if a = b then eq3 = testTrue end function function xor3(a,b) xor3 = not3(eq3(a,b)) end function function not3(b) not3 = 2-b end function '------------------------------------------------ function shortName3$(i) shortName3$ = word$("F ? T", i+1) end function function longName3$(i) longName3$ = word$("False,Don't know,True", i+1, ",") end function