Array Output

When READing OUT an array of character data, the values are bit-reversed, in addition to being subtracted from the preceding character. This table shows the bit-reversed version of the ASCII character set.

     00 80 40 C0  20 A0 60 E0  10 90 50 D0  30 B0 70 F0
00  nulsoh stxetx eotenq ackbel  bstab  lf vt  ff cr  so si
08  dledc1 dc2dc3 dc4nak synetb can em subesc  fs gs  rs us
04      !   "  #   $  %   &  '   (  )   *  +   ,  -   .  / 
0C   0  1   2  3   4  5   6  7   8  9   :  ;   <  =   >  ? 
02   @  A   B  C   D  E   F  G   H  I   J  K   L  M   N  O 
0A   P  Q   R  S   T  U   V  W   X  Y   Z  [   \  ]   ^  _ 
06   `  a   b  c   d  e   f  g   h  i   j  k   l  m   n  o 
0E   p  q   r  s   t  u   v  w   x  y   z  {   |  }   ~ del

Once you've looked up a character's bit-reversed value, you can subtract it from the bit-reversed value of the previous character to determine the value to output. For example, to output an "N" when the last character output was "I": the value of "N" is 72 in the table (note that the 16s digits are listed on top, and the ones digits to the left). Subtract this from 92, the value of "I", to give a difference of 20, or #32 in decimal.

Here is the same table, but ordered by value instead of by ASCII:

     00 10 20 30  40 50 60 70  80 90 A0 B0  C0 D0 E0 F0
00  nul bs eot ff stx lf ack so sohtab enq cr etx vt bel si
02   @  H   D  L   B  J   F  N   A  I   E  M   C  K   G  O 
04      (   $  ,   "  *   &  .   !  )   %  -   #  +   '  / 
06   `  h   d  l   b  j   f  n   a  i   e  m   c  k   g  o 
08  dlecan dc4 fs dc2sub syn rs dc1 em nak gs dc3esc etb us
0A   P  X   T  \   R  Z   V  ^   Q  Y   U  ]   S  [   W  _ 
0C   0  8   4  <   2  :   6  >   1  9   5  =   3  ;   7  ? 
0E   p  x   t  |   r  z   v  ~   q  y   u  }   s  {   w del


Unary Operator Truth Tables

The TriINTERCAL dialects introduce a number of new unary operators using bases other than 2. Since these are unfamiliar in the extreme to most programmers, truth tables for all INTERCAL operators have been provided below.

In the case of the what XOR operator, which is not commutative after base 2, the left and top digits correspond to the more and less significant digits, respectively.

Base 2 (binary)

 0 1      0 1      0 1
 0 0 1      0 0 0      1 0 1
 1 1 1      0 0 1      1 1 0

Base 3 (ternary)

 0 1 2      0 1 2      0 1 2
 0 0 1 2      0 0 0 0      0 0 1 0
 1 1 1 2      1 0 1 2      1 1 1 1
 2 2 2 2      2 0 2 2      2 0 1 2

 0 1 2      0 1 2
 0 0 2 1      0 0 1 2
 1 1 0 2      1 1 2 0
 2 2 1 0      2 2 0 1

Base 4 (quartary)

 0 1 2 3      0 1 2 3      0 1 2 3
 0 0 1 2 3      0 0 0 0 0      0 0 1 0 0
 1 1 1 2 3      1 0 1 2 3      1 1 1 1 1
 2 2 2 2 3      2 0 2 2 3      2 0 1 2 3
 3 3 3 3 3      3 0 3 3 3      3 0 1 3 3

2@ 0 1 2 3      0 1 2 3      0 1 2 3
 0 0 1 2 0      0 0 3 2 1      0 0 1 2 3
 1 1 1 2 1      1 1 0 3 2      1 1 2 3 0
 2 2 2 2 2      2 2 1 0 3      2 2 3 0 1
 3 0 1 2 3      3 3 2 1 0      3 3 0 1 2

Base 5 (quinary)

 0 1 2 3 4      0 1 2 3 4      0 1 2 3 4
 0 0 1 2 3 4      0 0 0 0 0 0      0 0 1 0 0 0
 1 1 1 2 3 4      1 0 1 2 3 4      1 1 1 1 1 1
 2 2 2 2 3 4      2 0 2 2 3 4      2 0 1 2 3 4
 3 3 3 3 3 4      3 0 3 3 3 4      3 0 1 3 3 4
 4 4 4 4 4 4      4 0 4 4 4 4      4 0 1 4 4 4

2@ 0 1 2 3 4     3@ 0 1 2 3 4
 0 0 1 2 0 0      0 0 1 2 3 0
 1 1 1 2 1 1      1 1 1 2 3 1
 2 2 2 2 2 2      2 2 2 2 3 2
 3 0 1 2 3 4      3 3 3 3 3 3
 4 0 1 2 4 4      4 0 1 2 3 4

 0 1 2 3 4      0 1 2 3 4
 0 0 4 3 2 1      0 0 1 2 3 4
 1 1 0 4 3 2      1 1 2 3 4 0
 2 2 1 0 4 3      2 2 3 4 0 1
 3 3 2 1 0 4      3 3 4 0 1 2
 4 4 3 2 1 0      4 4 0 1 2 3

Base 6 (sexary)

 0 1 2 3 4 5      0 1 2 3 4 5      0 1 2 3 4 5
 0 0 1 2 3 4 5      0 0 0 0 0 0 0      0 0 1 0 0 0 0
 1 1 1 2 3 4 5      1 0 1 2 3 4 5      1 1 1 1 1 1 1
 2 2 2 2 3 4 5      2 0 2 2 3 4 5      2 0 1 2 3 4 5
 3 3 3 3 3 4 5      3 0 3 3 3 4 5      3 0 1 3 3 4 5
 4 4 4 4 4 4 5      4 0 4 4 4 4 5      4 0 1 4 4 4 5
 5 5 5 5 5 5 5      5 5 5 5 5 5 5      5 0 1 5 5 5 5

2@ 0 1 2 3 4 5     3@ 0 1 2 3 4 5     4@ 0 1 2 3 4 5
 0 0 1 2 0 0 0      0 0 1 2 3 0 0      0 0 1 2 3 4 0
 1 1 1 2 1 1 1      1 1 1 2 3 1 1      1 1 1 2 3 4 1
 2 2 2 2 2 2 2      2 2 2 2 3 2 2      2 2 2 2 3 4 2
 3 0 1 2 3 4 5      3 3 3 3 3 3 3      3 3 3 3 3 4 3
 4 0 1 2 4 4 5      4 0 1 2 3 4 5      4 4 4 4 4 4 4
 5 0 1 2 5 5 5      5 0 1 2 3 5 5      5 0 1 2 3 4 5

 0 1 2 3 4 5      0 1 2 3 4 5
 0 0 5 4 3 2 1      0 0 1 2 3 4 5
 1 1 0 5 4 3 2      1 1 2 3 4 5 0
 2 2 1 0 5 4 3      2 2 3 4 5 0 1
 3 3 2 1 0 5 4      3 3 4 5 0 1 2
 4 4 3 2 1 0 5      4 4 5 0 1 2 3
 5 5 4 3 2 1 0      5 5 0 1 2 3 4

Base 7 (septary)

 0 1 2 3 4 5 6      0 1 2 3 4 5 6
 0 0 1 2 3 4 5 6      0 0 0 0 0 0 0 0
 1 1 1 2 3 4 5 6      1 0 1 2 3 4 5 6
 2 2 2 2 3 4 5 6      2 0 2 2 3 4 5 6
 3 3 3 3 3 4 5 6      3 0 3 3 3 4 5 6
 4 4 4 4 4 4 5 6      4 0 4 4 4 4 5 6
 5 5 5 5 5 5 5 6      5 0 5 5 5 5 5 6
 6 6 6 6 6 6 6 6      6 0 6 6 6 6 6 6

 0 1 2 3 4 5 6     2@ 0 1 2 3 4 5 6
 0 0 1 0 0 0 0 0      0 0 1 2 0 0 0 0
 1 1 1 1 1 1 1 1      1 1 1 2 1 1 1 1
 2 0 1 2 3 4 5 6      2 2 2 2 2 2 2 2
 3 0 1 3 3 4 5 6      3 0 1 2 3 4 5 6
 4 0 1 4 4 4 5 6      4 0 1 2 4 4 5 6
 5 0 1 5 5 5 5 6      5 0 1 2 5 5 5 6
 6 0 1 6 6 6 6 6      6 0 1 2 6 6 6 6

3@ 0 1 2 3 4 5 6     4@ 0 1 2 3 4 5 6
 0 0 1 2 3 0 0 0      0 0 1 2 3 4 0 0
 1 1 1 2 3 1 1 1      1 1 1 2 3 4 1 1
 2 2 2 2 3 2 2 2      2 2 2 2 3 4 2 2
 3 3 3 3 3 3 3 3      3 3 3 3 3 4 3 3
 4 0 1 2 3 4 5 6      4 4 4 4 4 4 4 4
 5 0 1 2 3 5 5 6      5 0 1 2 3 4 5 6
 6 0 1 2 3 6 6 6      6 0 1 2 3 4 6 6

5@ 0 1 2 3 4 5 6      0 1 2 3 4 5 6
 0 0 1 2 3 4 5 0      0 0 6 5 4 3 2 1
 1 1 1 2 3 4 5 1      1 1 0 6 5 4 3 2
 2 2 2 2 3 4 5 2      2 2 1 0 6 5 4 3
 3 3 3 3 3 4 5 3      3 3 2 1 0 6 5 4
 4 4 4 4 4 4 5 4      4 4 3 2 1 0 6 5
 5 5 5 5 5 5 5 5      5 5 4 3 2 1 0 6
 6 0 1 2 3 4 5 6      6 6 0 1 2 3 4 5

 0 1 2 3 4 5 6
 0 0 1 2 3 4 5 6
 1 1 2 3 4 5 6 0
 2 2 3 4 5 6 0 1
 3 3 4 5 6 0 1 2
 4 4 5 6 0 1 2 3
 5 5 6 0 1 2 3 4
 6 6 0 1 2 3 4 5


INTERCAL
Brian Raiter
Muppetlabs