CAN HAS COLOPHON?
This website is generated by a program written in LOLCODE, a programming language put together in 2007 by Adam Lindsay out of the captions people were writing on photographs of cats. The Institute chose it after a long meeting. Nobody remembers the meeting, which is how we know it was long.
What follows is a short course. The lessons are numbered in the order they occurred to us, which is not the order in which they should be read, which is not the order in which they appear. Read them in any order. The result is the same, and so is the confusion.
Lesson 1. Hello, and goodbye.
HAI 1.4
VISIBLE "HAI WORLD"
KTHXBYE
Every program opens with HAI and a version number and ends with KTHXBYE. Anything written after KTHXBYE is ignored, which is also the Institute's policy on correspondence.
Lesson 3. Variables.
HAI 1.4
I HAS A ATTEMPTS ITZ 3
ATTEMPTS R SUM OF ATTEMPTS AN 1
VISIBLE ATTEMPTS
KTHXBYE
This prints 4. The USB plug from HUG-0001 has been informed. I HAS A declares a variable, ITZ gives it a first value and R gives it another. A whole number is a NUMBR, a decimal is a NUMBAR, text is a YARN, an empty variable is a NOOB, and a boolean is a TROOF, which is either WIN or FAIL. There is no third value. It is the least quantum thing on this website and we are keeping an eye on it.
Lesson 2, which should have come before lesson 3. Arithmetic puts the operation first, the way the instructions on a tin of paint do.
HAI 1.4
VISIBLE SUM OF 2 AN 2
VISIBLE DIFF OF 10 AN 3
VISIBLE PRODUKT OF 6 AN 7
VISIBLE BIGGR OF 99 AN 100
KTHXBYE
That prints 4, 7, 42 and 100. QUOSHUNT OF divides. Dividing by zero is left as an exercise. Please don't do the exercise.
Lesson 4. Asking questions.
HAI 1.4
I HAS A ATTEMPTS ITZ 3
BOTH SAEM ATTEMPTS AN 3, O RLY?
YA RLY
VISIBLE "IT GOEZ IN"
NO WAI
VISIBLE "TURN IT OVR"
OIC
KTHXBYE
O RLY? asks, YA RLY is yes, NO WAI is no and OIC closes the matter. BOTH SAEM means equal and DIFFRINT means not equal. There is no "greater than". To find out whether a is bigger than b, you ask which of the two is BIGGR and then check whether the answer was a, the way one checks a lottery ticket.
Lesson 5. Doing something more than once.
HAI 1.4
IM IN YR DRAWER UPPIN YR SOCK TIL BOTH SAEM SOCK AN 10
VISIBLE SOCK
IM OUTTA YR DRAWER
KTHXBYE
Ten socks go into the drawer, numbered 0 to 9, and all ten come out again, in order. In LOLCODE this is called a loop. In a washing machine it would be called a miracle, see HUG-0004.
Lesson 6. Functions, or asking the Guru.
HAI 1.4
HOW IZ I ASK YR QUESTION
FOUND YR "IT DEPENDZ"
IF U SAY SO
VISIBLE I IZ ASK YR "WHY?" MKAY
KTHXBYE
HOW IZ I begins a function and IF U SAY SO ends it, which is roughly how the Institute approves budgets. FOUND YR hands back the answer. This function gives the same answer to every question. Peer review found nothing wrong with it.
Lesson 0. Comments.
HAI 1.4
BTW THIS LINE DOEZ NOTHING
OBTW
NEITHER DO THESE
TLDR
KTHXBYE
BTW starts a comment that runs to the end of the line. OBTW and TLDR open and close a longer one. The program behind this website contains no comments at all, BTW.
Lesson 7. The colon. Inside a string the colon is an escape character: :) is a new line, :> is a tab, :" is a quotation mark and :: is a colon.
HAI 1.4
VISIBLE "TEA AT 19::30:)DO NOT BE LATE"
KTHXBYE
That prints the time on one line and the warning on the next. The interpreter this site runs on, lci by Justin Meza, resolves the escapes again every time a string is touched. A colon read from a finding survives the first concatenation, sometimes the second, and on the third 19:30 turns into 19, a carriage return and 0. The Institute spent an afternoon on this. The afternoon has not been returned.
How this page was made. The program is called build.lol and runs to about eight hundred lines. LOLCODE can only look inside a string one byte at a time, with STRING'Z AT, so that is how it reads every finding. It can't list the files in a folder either, so it finds the notes by trying numbers in order, hug-0001, hug-0002 and so on, and stops after a hundred failures in a row, which is also how the Institute recruits. When it reads a note it swaps every colon for an invisible character, and when it writes the page, one byte at a time with STDIO'Z SCRIBBEL, it swaps them back. The whole site takes about a quarter of a second.
The previous version was written in Python. It was shorter, faster and correct, and was retired for those reasons.
KTHXBYE.