Next: , Previous: , Up: Top   [Index]


9 TriINTERCAL

INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL
no version 0.7+ version 1.-94.-8+ no

One extension to INTERCAL that is implemented by both C-INTERCAL and CLC-INTERCAL is known as TriINTERCAL, and extends INTERCAL to bases other than binary. Unlike ordinary INTERCAL programs, which have the extension ‘.i’, TriINTERCAL programs in bases from 3 to 7 (the only allowed bases) have extensions from ‘.3i’ to ‘.7i’ respectively.

The change of numeric base only affects expressions, and in particular the behaviour of operators, and the range of variables. (The onespot and twospot ranges become the highest number of trits or other digits in the base required that fit inside the binary ranges, so for instance, the maximum value of a onespot variable in ternary is 59048, or 3 to the power 10 minus 1.) Interleave/mingle is the simplest to explain; it alternates digits just as it alternated bits in binary. The other operators all change, as follows:

Note that the base doesn’t affect anything other than variable ranges and expressions; in particular, it doesn’t affect the bit-reversal used by Turing Tape I/O. (The tape still has characters written on it in binary, even though the program uses a different base.)


Next: , Previous: , Up: Top   [Index]