InterCal is an EsotericProgrammingLanguage more in the pursuit of fun and humor rather than practicality. It features many unique structures, such as ComeFrom (the "solution" to the GoToProblem). It lacks the standard mathematical operations, but has its own little head-spin operators which can be made to do the same tasks - interleave and select for binary operations, and and, or, and xor for unary operations. Sure, every language has and, inclusive or, and exclusive or, but only InterCal has them as unary operators.
-- EdGrimm
And InterCal is TuringComplete.
A full reference to Intercal (an acronym for "Compiler Language With No Pronounceable Acronym") is available here. [http://www.muppetlabs.com/~breadbox/intercal-man/] -- WillSargent
See homepage at http://www.muppetlabs.com/~breadbox/intercal/
InterCal is also the home of the ComeFrom statement, necessary for true structured programming. Parallel Intercal generalizes the ComeFrom statement to allow multiple branches from one label (which will spawn a process for every ComeFrom). The scary thing is that this could even be considered elegant in an evil, twisted way.
They accept "OH", "ZERO", "ONE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE", "NINER", as well as the other language, they accept "NINER" instead of "NINE", why don't they accept "FOWER" instead of "FOUR" and "FIFE" instead of "FIVE"? That is actually the correct way to say on air traffic control, but most people never actually do that.
Well, I guess you should modify the compiler and submit patches for this new feature!
Here is a program that I made in InterCal to add 2 numbers together. This program is clear (at least to me it is clear), but the standard library I find confusing and cannot follow it. I figured this out myself, not from example. I don't know if anybody else has different ways of adding 2 numbers together in InterCal.
DO WRITE IN .1 DO WRITE IN .2 DO (1) NEXT DO READ OUT .1 PLEASE GIVE UP PLEASE STOP GIVING UP (1) DO COME FROM (3) (3) DO (2) NEXT (2) DO .3 <- "?'.1$.2'"~'#0$#65535' DO .2 <- "&'.1$.2'"~'#0$#65535' PLEASE .2 <- '.2$#0'~'#65535$#1' PLEASE DO .1 <- .3 DO .3 <- '.2~.2'~#1 DO .3 <- "?'.3$#1'"~#1 PLEASE DO FORGET .3 DO RESUME #1I use the ComeFrom command to make the loop repeat, .3 will be set to the XOR (non-carrying adding), and the .2 is for the carrying line, and then PLEASE .2 does to multiply the carrying line by 2, and then set .1 to .3 so it can add again, and then .3 to select a number against itself (if a number is selected against itself, the bit0 will always be 1 if the number is not zero) (to see if it needs to carry), and then to change 1 to 0 and 0 to 1 (because the FORGET will forget the loop if is 1, otherwise 0) and repeat
The ?,&,V operators are equivalent to cellular automata:
? = rule 102 & = rule 136 V = rule 238Try doing just 1 operator, like this:
#102*.1 == .?1 #136*:2 == :&2
See Also: EsotericProgrammingLanguage