TriINTERCAL programs are distinguished from INTERCAL programs by the filename extension; .3i (as opposed to .i). There is often no other way to tell them apart, because BUT and sharkfin aren't really that useful and so are not often used, and INTERCAL programs don't necessarily specify constants above 59048.
TriINTERCAL differs from INTERCAL only in the width of the data types (one-spot data types are 10 trits wide and two-spot data types are 20 trits wide), and in the operators available in expressions. AND and OR are generalizations of the INTERCAL binary versions, BUT is new, and sharkfin and what are two different interpretations of XOR (both of which are available in TriINTERCAL). Mingle mingles trits, rather than bits, whereas select ANDs the two original numbers, then sorts all the bits in the first number corresponding to 2s in the second number to the least significant end, 0s in the second number to the most significant end, and 1s in between them.
AND, OR, mingle, and select operate just like their binary counterparts if no trits with the value 2 are present.
DO .1 <- #1 $ #0 DO READ OUT .1 PLEASE GIVE UP
(This program is right on the boundary as far as politeness is concerned; any more polite and it would be too polite.)
The following program reads in (or WRITES IN) a twospot number, and then outputs the result of applying all 5 ternary logical operations to it:
DO WRITE IN :1 DO :2 <- :&1 PLEASE READ OUT :2 DO :2 <- :V1 PLEASE READ OUT :2 DO :2 <- :@1 DO READ OUT :2 DO :2 <- :^1 DO READ OUT :2 DO :2 <- :?1 DO READ OUT :2 PLEASE GIVE UP
When given the input ONE TWO THREE FOUR FIVE SIX SEVEN, this program gives the following output:
_ LMMDCCCLVII __________ mclxMMMDCCCLIVDCCVIII _______ mclxMMCCCXVXLV _____________ mclxMMMDCCCXXVIIIDCCXCVII ______ mclxMMMCCXMMCIX
In wimpmode, the output looks like this (with the input 1234567):
52857 1163854708 1162315045 1163828797 1163212109
which, unfortunately, is still unintelligible in decimal. So in ternary:
3r00000000002200111200 3r10000002222221111221 3r10000000002201111101 3r10000002221121222021 3r10000001210022000222
(here, the input is the same value, now written 3r00000002022201111201.)
Also see External INTERCAL resources.