Chris Rathman / Chris.Rathman@tx.rr.com

INTERCAL Notes

Variables & Arrays
#n                   constant
.n                   16 bit variable                        :n             32 bit variable
,n                   16 bit array                           ;n             32 bit array
,n <- x              dimension array                        ;n <- x        dimension array
,nSUBx               array cell subscript                   ;nSUBx         array cell subscript

Operators
x$y                  mingle (15$0 => %1111$0000 = %10101010 = $AA <= 170)
x~y                  select (13~10 => %1101~1010 = %10 = $2 <= 2)
&x                   logical AND (to right of var or constant selector - .&1)
Vx                   logical OR
?x                   logical XOR
'exp'                precedence parens                      "exp"          precedence parens

Statement Declaration
(n)                  line label
DO                   statement (aka PLEASE or PLEASE DO)
DO NOT               abstain (aka DON'T, PLEASE DO NOT or PLEASE DON'T)
DO %n                percent chance of execution (%0-%100)

Statements
x <- y               assignment
(n)                  gosub n
FORGET #n            discard n entries on the call stack
RESUME               return
STASH list           save off vars/arrays (.1+.2+,1)
RETRIEVE list        restore vars/arrays
IGNORE list          no side effects on vars/arrays in list
REMEMBER list        restore side effects on vars/arrays in list
ABSTAIN FROM glist   abstain from item(s) in gerund list
REINSTATE glist      reinstate item(s) in gerund list
GIVE UP              exit program
WRITE IN list        input
READ OUT list        output
COME FROM (n)        come from label

Gerund list
(n)
STASHING
IGNORING
FORGETTING
NEXTING
CALCULATING

 01 $01 %0000:0001     %1000:0000 $80  $80   128           65 $41 %0100:0001  A  %1000:0010 $82  $7E   126
 02 $02 %0000:0010     %0100:0000 $40  $C0   192           66 $42 %0100:0010  B  %0100:0010 $42  $BE   190
 03 $03 %0000:0011     %1100:0000 $C0  $40    64           67 $43 %0100:0011  C  %1100:0010 $C2  $3E    62
 04 $04 %0000:0100     %0010:0000 $20  $E0   224           68 $44 %0100:0100  D  %0010:0010 $22  $DE   222
 05 $05 %0000:0101     %1010:0000 $A0  $60    96           69 $45 %0100:0101  E  %1010:0010 $A2  $5E    94
 06 $06 %0000:0110     %0110:0000 $60  $A0   160           70 $46 %0100:0110  F  %0110:0010 $62  $9E   158
 07 $07 %0000:0111     %1110:0000 $E0  $20    32           71 $47 %0100:0111  G  %1110:0010 $E2  $1E    30
 08 $08 %0000:1000     %0001:0000 $10  $F0   240           72 $48 %0100:1000  H  %0001:0010 $12  $EE   238
 09 $09 %0000:1001     %1001:0000 $90  $70   112           73 $49 %0100:1001  I  %1001:0010 $92  $6E   110
 10 $0A %0000:1010     %0101:0000 $50  $B0   176           74 $4A %0100:1010  J  %0101:0010 $52  $AE   174
 11 $0B %0000:1011     %1101:0000 $D0  $30    48           75 $4B %0100:1011  K  %1101:0010 $D2  $2E    46
 12 $0C %0000:1100     %0011:0000 $30  $D0   208           76 $4C %0100:1100  L  %0011:0010 $32  $CE   206
 13 $0D %0000:1101     %1011:0000 $B0  $50    80           77 $4D %0100:1101  M  %1011:0010 $B2  $4E    78
 14 $0E %0000:1110     %0111:0000 $70  $90   144           78 $4E %0100:1110  N  %0111:0010 $72  $8E   142
 15 $0F %0000:1111     %1111:0000 $F0  $10    16           79 $4F %0100:1111  O  %1111:0010 $F2  $0E    14
 16 $10 %0001:0000     %0000:1000 $08  $F8   248           80 $50 %0101:0000  P  %0000:1010 $0A  $F6   246
 17 $11 %0001:0001     %1000:1000 $88  $78   120           81 $51 %0101:0001  Q  %1000:1010 $8A  $76   118
 18 $12 %0001:0010     %0100:1000 $48  $B8   184           82 $52 %0101:0010  R  %0100:1010 $4A  $B6   182
 19 $13 %0001:0011     %1100:1000 $C8  $38    56           83 $53 %0101:0011  S  %1100:1010 $CA  $36    54
 20 $14 %0001:0100     %0010:1000 $28  $D8   216           84 $54 %0101:0100  T  %0010:1010 $2A  $D6   214
 21 $15 %0001:0101     %1010:1000 $A8  $58    88           85 $55 %0101:0101  U  %1010:1010 $AA  $56    86
 22 $16 %0001:0110     %0110:1000 $68  $98   152           86 $56 %0101:0110  V  %0110:1010 $6A  $96   150
 23 $17 %0001:0111     %1110:1000 $E8  $18    24           87 $57 %0101:0111  W  %1110:1010 $EA  $16    22
 24 $18 %0001:1000     %0001:1000 $18  $E8   232           88 $58 %0101:1000  X  %0001:1010 $1A  $E6   230
 25 $19 %0001:1001     %1001:1000 $98  $68   104           89 $59 %0101:1001  Y  %1001:1010 $9A  $66   102
 26 $1A %0001:1010     %0101:1000 $58  $A8   168           90 $5A %0101:1010  Z  %0101:1010 $5A  $A6   166
 27 $1B %0001:1011     %1101:1000 $D8  $28    40           91 $5B %0101:1011  [  %1101:1010 $DA  $26    38
 28 $1C %0001:1100     %0011:1000 $38  $C8   200           92 $5C %0101:1100  \  %0011:1010 $3A  $C6   198
 29 $1D %0001:1101     %1011:1000 $B8  $48    72           93 $5D %0101:1101  ]  %1011:1010 $BA  $46    70
 30 $1E %0001:1110     %0111:1000 $78  $88   136           94 $5E %0101:1110  ^  %0111:1010 $7A  $86   134
 31 $1F %0001:1111     %1111:1000 $F8  $08     8           95 $5F %0101:1111  _  %1111:1010 $FA  $06     6
 32 $20 %0010:0000     %0000:0100 $04  $FC   252           96 $60 %0110:0000  `  %0000:0110 $06  $FA   250
 33 $21 %0010:0001  !  %1000:0100 $84  $7C   124           97 $61 %0110:0001  a  %1000:0110 $86  $7A   122
 34 $22 %0010:0010  "  %0100:0100 $44  $BC   188           98 $62 %0110:0010  b  %0100:0110 $46  $BA   186
 35 $23 %0010:0011  #  %1100:0100 $C4  $3C    60           99 $63 %0110:0011  c  %1100:0110 $C6  $3A    58
 36 $24 %0010:0100  $  %0010:0100 $24  $DC   220          100 $64 %0110:0100  d  %0010:0110 $26  $DA   218
 37 $25 %0010:0101  %  %1010:0100 $A4  $5C    92          101 $65 %0110:0101  e  %1010:0110 $A6  $5A    90
 38 $26 %0010:0110  &  %0110:0100 $64  $9C   156          102 $66 %0110:0110  f  %0110:0110 $66  $9A   154
 39 $27 %0010:0111  '  %1110:0100 $E4  $1C    28          103 $67 %0110:0111  g  %1110:0110 $E6  $1A    26
 40 $28 %0010:1000  (  %0001:0100 $14  $EC   236          104 $68 %0110:1000  h  %0001:0110 $16  $EA   234
 41 $29 %0010:1001  )  %1001:0100 $94  $6C   108          105 $69 %0110:1001  i  %1001:0110 $96  $6A   106
 42 $2A %0010:1010  *  %0101:0100 $54  $AC   172          106 $6A %0110:1010  j  %0101:0110 $56  $AA   170
 43 $2B %0010:1011  +  %1101:0100 $D4  $2C    44          107 $6B %0110:1011  k  %1101:0110 $D6  $2A    42
 44 $2C %0010:1100  ,  %0011:0100 $34  $CC   204          108 $6C %0110:1100  l  %0011:0110 $36  $CA   202
 45 $2D %0010:1101  -  %1011:0100 $B4  $4C    76          109 $6D %0110:1101  m  %1011:0110 $B6  $4A    74
 46 $2E %0010:1110  .  %0111:0100 $74  $8C   140          110 $6E %0110:1110  n  %0111:0110 $76  $8A   138
 47 $2F %0010:1111  /  %1111:0100 $F4  $0C    12          111 $6F %0110:1111  o  %1111:0110 $F6  $0A    10
 48 $30 %0010:0000  0  %0000:0100 $04  $FC   252          112 $70 %0111:0000  p  %0000:1110 $0E  $F2   242
 49 $31 %0011:0001  1  %1000:1100 $8C  $74   116          113 $71 %0111:0001  q  %1000:1110 $8E  $72   114
 50 $32 %0011:0010  2  %0100:1100 $4C  $B4   180          114 $72 %0111:0010  r  %0100:1110 $4E  $B2   178
 51 $33 %0011:0011  3  %1100:1100 $CC  $34    52          115 $73 %0111:0011  s  %1100:1110 $CE  $32    50
 52 $34 %0011:0100  4  %0010:1100 $2C  $D4   212          116 $74 %0111:0100  t  %0010:1110 $2E  $D2   210
 53 $35 %0011:0101  5  %1010:1100 $AC  $54    84          117 $75 %0111:0101  u  %1010:1110 $AE  $52    82
 54 $36 %0011:0110  6  %0110:1100 $6C  $94   148          118 $76 %0111:0110  v  %0110:1110 $6E  $92   146
 55 $37 %0011:0111  7  %1110:1100 $EC  $14    20          119 $77 %0111:0111  w  %1110:1110 $EE  $12    18
 56 $38 %0011:1000  8  %0001:1100 $1C  $E4   228          120 $78 %0111:1000  x  %0001:1110 $1E  $E2   226
 57 $39 %0011:1001  9  %1001:1100 $9C  $64   100          121 $79 %0111:1001  y  %1001:1110 $9E  $62    98
 58 $3A %0011:1010  :  %0101:1100 $5C  $A4   164          122 $7A %0111:1010  z  %0101:1110 $5E  $A2   162
 59 $3B %0011:1011  ;  %1101:1100 $DC  $24    36          123 $7B %0111:1011  {  %1101:1110 $DE  $22    34
 60 $3C %0011:1100  <  %0011:1100 $3C  $C4   196          124 $7C %0111:1100  |  %0011:1110 $3E  $C2   194
 61 $3D %0011:1101  =  %1011:1100 $BC  $44    68          125 $7D %0111:1101  }  %1011:1110 $BE  $42    66
 62 $3E %0011:1110  >  %0111:1100 $7C  $84   132          126 $7E %0111:1110  ~  %0111:1110 $7E  $82   130
 63 $3F %0011:1111  ?  %1111:1100 $FC  $04     4          127 $7F %0111:1111     %1111:1110 $FE  $02     2
 64 $40 %0100:0000  @  %0000:0010 $02  $FE   254

Chris Rathman / Chris.Rathman@tx.rr.com