FUNCTION and3(a, b) IF a < b then LET and3 = a else LET and3 = b END FUNCTION FUNCTION eq3(a, b) IF a = tDontknow or b = tDontKnow then LET eq3 = tdontknow ELSEIF a = b then LET eq3 = ttrue ELSE LET eq3 = tfalse END IF END FUNCTION FUNCTION longname3$(i) SELECT CASE i CASE 1 LET longname3$ = "Don't know" CASE 2 LET longname3$ = "True" CASE else LET longname3$ = "False" END SELECT END FUNCTION FUNCTION not3(b) LET not3 = 2-b END FUNCTION FUNCTION or3(a, b) IF a > b then LET or3 = a else LET or3 = b END FUNCTION FUNCTION shortname3$(i) LET shortname3$ = ("F?T")[i+1:i+1+1-1] END FUNCTION FUNCTION xor3(a, b) LET xor3 = not3(eq3(a,b)) END FUNCTION LET tfalse = 0 LET tdontknow = 1 LET ttrue = 2 PRINT "Nombres cortos y largos para valores lógicos ternarios:" FOR i = tfalse to ttrue PRINT shortname3$(i); " "; longname3$(i) NEXT i PRINT PRINT "Funciones de parámetro único" PRINT "x"; " "; "=x"; " "; "not(x)" FOR i = tfalse to ttrue PRINT shortname3$(i); " "; shortname3$(i); " "; shortname3$(not3(i)) NEXT i PRINT PRINT "Funciones de doble parámetro" PRINT "x"; " "; "y"; " "; "x AND y"; " "; "x OR y"; " "; "x EQ y"; " "; "x XOR y" FOR a = tfalse to ttrue FOR b = tfalse to ttrue PRINT shortname3$(a); " "; shortname3$(b); " "; PRINT shortname3$(and3(a,b)); " "; shortname3$(or3(a,b)); " "; PRINT shortname3$(eq3(a,b)); " "; shortname3$(xor3(a,b)) NEXT b NEXT a END