Talk:INTERCAL

From Esolang
Jump to navigation Jump to search

Cellular automata

The ?,&,V operators are equivalent to cellular automata:

? = rule 102
& = rule 136
V = rule 238

Try doing just 1 operator, like this:

#102*.1 == .?1
#136*:2 == :&2

This also makes it easy to make a cellular automata program in INTERCAL, do rule 102 like:

DO COME FROM (105)
PLEASE DO .112 <- .?112
(105) DO (256) NEXT

INTERCAL is Turing-complete

Moved to its own page: INTERCAL Turing-completeness proof. Alksentrs 23:36, 21 January 2008 (UTC)


Re: INTERCAL is Turing-complete

Moved to Talk:INTERCAL Turing-completeness proof. Alksentrs 23:45, 21 January 2008 (UTC)

INTERCAL is not Compiler Language With No Pronouncable Acronym

INTERCAL can be said in-ter-cal (the 'A' is 'A' an in cat ) --(this comment by 72.25.192.4 at 23:10, 13 September 2009 UTC; please sign your comments with ~~~~)

     __        ___   _  ___   ___  ____  _   _
__/\_\ \      / / | | |/ _ \ / _ \/ ___|| | | |_/\__
\    /\ \ /\ / /| |_| | | | | | | \___ \| |_| \    /
/_  _\ \ V  V / |  _  | |_| | |_| |___) |  _  /_  _\
  \/    \_/\_/  |_| |_|\___/ \___/|____/|_| |_| \/

--Ørjan 01:19, 14 September 2009 (UTC)

Binary operators

I would find the INTERCAL binary select operator, as well as its (almost) inverse (filling unused positions with zero), to be very useful to have in other programming languages too; not only INTERCAL. --Zzo38 (talk) 20:38, 11 March 2013 (UTC)

Apparently Intel agrees with you. These instructions have been implemented as machine code instructions on modern x86_64 processors (although with different names). --ais523 22:50, 9 April 2020 (UTC)

Hardware INTERCAL

Is there INTERCAL into Verilog, VHDL, and discrete logic? --Zzo38 (talk) 20:38, 11 March 2013 (UTC)

Quick Perl one-line to check your politeness

my$t="";while(<>){$t.=$_};$t=~s/PLEASE\s*DO/PLEASE/,$p=()=$t=~/PLEASE/g,$d=()=$t=~/DO/g,$f=($d+$p)/$p;print$f>=3&&$f<=5?1:0;print"\n".1/$f;

Provide your INTERCAL program as input. The first line of output is 1 if you're correct, 0 if not. The second line of output is the percentage of statements that are polite, as a decimal. For the least amount of future editing required, the percentage should be somewhere around 0.266. There is a glitch if you don't put a space in READ OUT (which will count as an extra DO). BoundedBeans (talk) 01:51, 29 July 2024 (UTC)

Useful functions made using INTERCAL's unary / binary operators

Useless, uncontrollable, and unpleasant. These are all adjectives that have been used to describe INTERCAL's binary and unary operators. I won't try to disprove these claims, but I will try to provide some useful functions I've made using these operators.

"&#65535$.1"~"#65535$#0"

The first part (&#65535$.1) can be seen as "stretching" .1 with rotation given to the right. Selecting out of that value every first bit (through ~"#65535$#0", or ~#2863311530) returns the value of .1 with rotation to the right. So if .1 was #10 (00001010), out of stretching you'd get #102 (0000000001100110), and out of selecting every first bit you'd get #5 (00000101). If you wanted to instead shift to the right, then all you'd need to do is replace either instance of #65535 with #32767 (0111111111111111), which throws away the bit closest to the left.

"&.1$.2"~"#0$#65535"
"V.1$.2"~"#0$#65535"
"?.1$.2"~"#0$#65535"

These are the unary operators converted into binary. You can do this by mingling the two arguments together, applying the unary operation, and selecting out every second value. This is actually used in the INTERCAL system library, which I think is neat. I should probably note just how useless all of these functions are without an approach to conditional logic, but there are plenty of ways to do this through using a computed goto.

--Jasper (talk) 11:14, 10 November 2025 (UTC)