Learn INTERCAL with Real Code Examples
Updated Nov 25, 2025
Code Sample Descriptions
1
Hello World in INTERCAL
PLEASE NOTE THAT THIS PROGRAM PRINTS "HELLO, WORLD".
DO ,1 <- #13
DO ,1 SUB #1 <- #238
PLEASE DO ,1 <- #1
DO READ OUT ,1
PLEASE GIVE UP
A traditional 'Hello World' in INTERCAL, showcasing the verbose and satirical style of the language.
2
INTERCAL Simple Addition
DO ,1 <- #5
DO ,2 <- #10
DO ,3 <- ,1
DO ,3 <- ,3 + ,2
PLEASE DO ,3 <- ,3
PLEASE GIVE UP
Performs addition of two numbers in INTERCAL.
3
INTERCAL Count to 5
DO ,1 <- #1
DO ,2 <- #5
(LOOP) PLEASE DO ,1 <- ,1 + #1
DO ,3 <- ,1
DO ,3 SUB #1 <- ,3
PLEASE COME FROM (LOOP) NEXT
PLEASE GIVE UP
Counts from 1 to 5 using INTERCAL loops.
4
INTERCAL Hello Name
DO ,1 <- #72
DO ,2 <- #101
DO ,3 <- #108
DO ,4 <- #108
DO ,5 <- #111
DO ,6 <- #44
DO ,7 <- #32
DO ,8 <- #65
DO ,9 <- #108
DO ,10 <- #105
DO ,11 <- #99
DO ,12 <- #101
DO ,13 <- #33
DO READ OUT ,1
DO READ OUT ,2
DO READ OUT ,3
DO READ OUT ,4
DO READ OUT ,5
DO READ OUT ,6
DO READ OUT ,7
DO READ OUT ,8
DO READ OUT ,9
DO READ OUT ,10
DO READ OUT ,11
DO READ OUT ,12
DO READ OUT ,13
PLEASE GIVE UP
Prints a custom name in INTERCAL.
5
INTERCAL Bitwise NOT Example
DO ,1 <- #42
DO ,2 <- ,1 ~ #255
PLEASE DO ,2
PLEASE GIVE UP
Applies bitwise NOT to a number.
6
INTERCAL Swap Variables
DO ,1 <- #7
DO ,2 <- #13
DO ,3 <- ,1
DO ,1 <- ,2
DO ,2 <- ,3
PLEASE GIVE UP
Swaps two variables in INTERCAL.
7
INTERCAL Multiply by Repeated Addition
DO ,1 <- #4
DO ,2 <- #3
DO ,3 <- #0
(LOOP) DO ,3 <- ,3 + ,1
DO ,2 <- ,2 - #1
PLEASE COME FROM (LOOP) NEXT
PLEASE DO ,3
PLEASE GIVE UP
Multiplies two numbers using repeated addition.
8
INTERCAL Print Digits 0-9
DO ,1 <- #0
(LOOP) DO READ OUT ,1
DO ,1 <- ,1 + #1
PLEASE COME FROM (LOOP) NEXT
PLEASE GIVE UP
Prints digits 0 through 9.
9
INTERCAL Conditional Example
DO ,1 <- #10
(LOOP) PLEASE DO ,1 <- ,1 - #1
(END) PLEASE COME FROM (LOOP) NEXT
PLEASE GIVE UP
Executes code conditionally using COME FROM.
10
INTERCAL Reverse Number
DO ,1 <- #123
DO ,2 <- #0
DO ,3 <- ,1
(LOOP) DO ,2 <- ,2 * #10 + ,3 MOD #10
DO ,3 <- ,3 / #10
PLEASE COME FROM (LOOP) NEXT
PLEASE DO ,2
PLEASE GIVE UP
Reverses a number using intermediate storage.