# Introduction

Bad news guys - you got detention. Your English teacher doesn't understand this site and wants you to "stop doing math on your digital dohickeys, this is English class!"

She sentenced you to write her favorite saying on the blackboard 25 times, which will give a total of 100 lines on the blackboard.

The eighteen-hundreds were a time for rum.
The nineteen-hundreds were a time for fun.
The two-thousands are a time to run
a civilized classroom.


Lucky for you, you are an avid reader (not to mention an expert code-golfer)! You have a read about a trick that might possibly get you off easy.

(Foxtrot by Bill Amend)

Unfortunately for Jason, it didn't work out. But you have a better idea! Since your English teacher thinks you're doing math, if you leave all the numbers out of your program it just might work! You also want to keep your program as short as possible because you are a lazy student and don't want to write a lot on the board.

## Write a program that complies with the following rules:

• Your program must print the 4 above lines 25 times. The lines must be outputted in that order, repeating. Total exactly 100 lines of output (a trailing newline at the very end or a leading newline at the very beginning is okay).
• You cannot use the characters 0123456789. Your teacher gets confused by math and will call you out!
• You can use any imports and external libraries without counting the imports. Your English teacher doesn't know about programming. Jason could have saved a lot of work by not writing #include <stdio.h> and you don't want to make his same mistakes!
• Score your program by byte count. Lowest score wins!
• If the text would've read "1900s", writing the output would've been slightly more tricky. – Ingo Bürk Oct 23 '14 at 14:50
• to the comix: he's not printing \n's, and the loop from 1 is pretty awkward (like against C nature)... – V-X Oct 23 '14 at 15:41
• @V-X Bill Amend is a long-time Pascal die-hard, and whenever he writes C that becomes pretty apparent. – fluffy Oct 23 '14 at 18:09
• This sounds very much like one of my old English teachers. – Kaz Wolfe Oct 25 '14 at 16:58
• Banning + would have made sense here, but maybe that would have been too difficult. – Pharap Oct 28 '14 at 9:38

# CJam, 109107106104 103 bytes

0000000: 22 0c 20 4f 18 41 e4 d8 a5 f3 95 cf 5e 2b cb 1c  ". O.A......^+..
0000010: 44 64 2f bf 28 23 e2 47 4e 4e 77 73 fc 43 09 a2  Dd/.(#.GNNws.C..
0000020: 09 0b fb 18 29 e8 e8 49 5d fc 00 da b8 70 b6 3e  ....)..I]....p.>
0000030: 0c 24 d7 5a 5b 28 1c 45 2e 90 63 86 04 5c 3e 95  .$.Z[(.E..c..\>. 0000040: 4b ae 66 22 48 48 2a 62 46 47 2b 62 22 54 0a 20 K.f"HH*bFG+b"T. 0000050: 2d 2e 22 27 7b 2c 57 25 7c 66 3d 7b 28 2f 29 2a -."'{,W%|f={(/)* 0000060: 7d 5a 2a 43 44 2b 2a }Z*CD+*  The above is a reversible xxd dump. ### Testing You can generate and execute the above code by running this in the online interpreter: "bxyyeighxrum.yninexfun.ytwo-thousands abto run a civilized classroom.y The xteen-hundreds webfor bre a time ""T -."'{,W%|f#31bHH*b:c'\2*/'\*"HH*bFG+b""T -.""'{,W%|f={(/)*}Z*CD+*"]:+~  To see the generated code (without executing it), remove the final ~. To count the number of bytes (one character is one byte in ISO-8859-1), replace the final ~ with a ,. ### Printable version (122 bytes) "bxyyeighxrum.yninexfun.ytwo-thousands abto run a civilized classroom.y The xteen-hundreds webfor bre a time "{(/)*}Z*CD+*  After pushing the string (S), the following gets executed: { }Z* " Repeat 3 times: "; ( " Q := S.shift() "; / " T := S.split(Q) "; ) " R := T.pop() "; * " S := T.join(R) "; CD+* " S *= 12 + 13 ";  ### Moar golfing After pushing the unprintable string (U), the following gets executed: HH*b " U := U.base(17 * 17) "; FG+b " U := U.base(15 + 16) "; "T\n -." " P := 'T\n -.' "; '{,W%| " P |= 'zyx...\0' "; f= " U[i] -> P[U[i]] ";  This pushes the string of the printable version. The rest of the code works as before. • Using the code, I get this generated code which is 144 bytes. Am I doing something wrong ? – Optimizer Oct 23 '14 at 22:49 • UTF-8 encoding would result in a higher byte count, yes. With ISO-8859-1, the byte count is 109. You can replace ~ with , to verify. – Dennis Oct 23 '14 at 22:53 • I got the exact result Optimizer did, but adding the ]:+~ made it work. Why don't you just add that to your code? – Luminous Oct 24 '14 at 3:12 • @user23013: The Java interpreter respects$LANG for I/O. Internally, CJam just has 16-bit chars. – Dennis Oct 24 '14 at 11:37
• You actually do not have to unicode-ize your solution as without compression itself it is only 124 bytes, beating all others. – Optimizer Oct 24 '14 at 21:23

# JavaScript (ES6) 164

B='teen-hundreds were a time',alert(B.replace(/./g,
"The eigh"+B+" for rum.\nThe nine"+B+" for fun.\nThe two-thousands are a time to run\na civilized classroom.\n"))


Test In FireFox/FireBug console.

• This is genius! – Optimizer Oct 23 '14 at 17:09
• Yup, replacing each character by the larger string. Making 25 copies of the larger string. – Optimizer Oct 23 '14 at 17:49
• @Optimizer That is genius :) – FryAmTheEggman Oct 23 '14 at 17:49
• @Malvolio In fact the repeated section is 30 characters. And I could show a huge sequence of attempts, adding and cutting words and replacing replaces before finding this simple solution. – edc65 Oct 24 '14 at 12:13
• @IsmaelMiguel I think you mean any ES6 browser. Problem: at time this challenge was posted, template strings were not implemented in any browser: Firefox was the first - rel 34, dec first 2014 - then Chrome, march 2015. But even without template strings your scoure would be 153, better than mine. You should post it as an answer. – edc65 Sep 27 '15 at 20:03

# Python : 188 173 160 153

a="teen-hundreds were a time"
print"The eigh%s for rum.\nThe nine%s for fun.\nThe two-thousands are a time to run\na civilized classroom.\n"%(a,a)*len(a)


I don't python much, but this seems pretty short to me.

Edit: So I was wrong, it wasn't short at all! Thanks for the assistance in comments :D

• You could lose the newline and indent on the for loop to save a couple of bytes. – Holloway Oct 23 '14 at 15:39
• @Geobits, I make that 157 – Holloway Oct 23 '14 at 16:11
• @Geobits are you running on a windows machine? The line encodings in windows are frequently \r\n instead of just \n. That might be why it's showing 157 bytes for us, but 160 for you. – Rob Watts Oct 23 '14 at 17:49
• This is 160 only. You are probably skipping the three \ in \n due to escaping ... – Optimizer Oct 23 '14 at 17:51
• You can move the value for b into the print: % has higher precedence than *. – FryAmTheEggman Oct 23 '14 at 19:22

## CJam, 151 140 135 132 130128 bytes (Tweetable)

"TeighYrum.TnineYfun.Ttwo-thousands are a time to run
a civilized classroom.""YT"["teen-hundreds were a time for ""
The "]erAF+*


Try it here

I am able to shorten this down to 110 bytes by converting this to unicode, but since that is not beating the other unicode solution, I would rather not put it :)

• Hey, what's that :D emoticon doing there?! Are you texting your friends during detention? Go to the principal's office! – Doorknob Oct 23 '14 at 21:11
• @Doorknob :D :P – Optimizer Oct 23 '14 at 21:16
• Maybe you could make T alias to .\nThe , then remove the extra line that this produces from the start of the output string (my cjam-fu isn't good enough to figure out whether you can easily do that) – user16402 Oct 24 '14 at 7:21
• @professorfish that ends up consuming more bytes than it saves. mothereff.in/…*%28Y%2F%28%40\ – Optimizer Oct 24 '14 at 7:48
• Nitpicking: Using the upper 128 bytes of an ASCII-compatible code page has nothing to do with Unicode. – Dennis Oct 25 '14 at 16:39

# PHP, 0 bytes

You can use any imports and external libraries without counting the imports.

To run this code, you must import a library called data://text/plain,<?php...classroom.\n"; with this:

<?php require_once 'data://text/plain,<?php
The nine${d} for fun. two-thousands are a time to run a civilized classroom. )) Works only in latest Firefox (34 and above) due to use of template strings. • @Nijikokun You know that will cause 30 repetitions instead of 25, right ? – Optimizer Oct 24 '14 at 20:45 • I am guessing that ff 34 is beta or something since I am on latest (just checked) and it is 33 and it does not work on there – Sammaye Oct 28 '14 at 16:12 ## BrainFuck (1,597 characters) +++++++++++++++++++++++++[>->-[--->+<]>-.[---->+++++<]>-.---.--[--->+<]>-.+[->+++<]>++.++++.--.+.++++++++++++.+++[->+++<]>..+++++++++.[----->++<]>+.[->++++++++<]>.[--->+<]>---.-------.----------.++++++++++++++.-------------.-.--[--->+<]>---.+[---->+<]>+++.--[->++++<]>-.[->+++<]>.+++++++++++++.-------------.--[--->+<]>-.[->+++<]>+.-[->+++<]>.---[->++++<]>.-----------.++++.--------.--[--->+<]>-.++[->+++<]>.+++++++++.+++.[-->+++++<]>+++.---[----->++<]>.+++.--------.+[----->++<]>++.>++++++++++.>-[--->+<]>-.[---->+++++<]>-.---.--[--->+<]>-.+[----->+<]>+.-----.+++++.---------.[--->+<]>---.+++[->+++<]>..+++++++++.[----->++<]>+.[->++++++++<]>.[--->+<]>---.-------.----------.++++++++++++++.-------------.-.--[--->+<]>---.+[---->+<]>+++.--[->++++<]>-.[->+++<]>.+++++++++++++.-------------.--[--->+<]>-.[->+++<]>+.-[->+++<]>.---[->++++<]>.-----------.++++.--------.--[--->+<]>-.++[->+++<]>.+++++++++.+++.[-->+++++<]>+++.++[->+++<]>.-[--->+<]>--.-------.[----->++<]>++.>++++++++++.>-[--->+<]>-.[---->+++++<]>-.---.--[--->+<]>-.---[->++++<]>.+++.--------.[->+++++<]>++.+[--->++<]>.------------.+++++++.++++++.--.++[->+++<]>++.+++++++++++++.----------.--[--->+<]>---.+[---->+<]>+++.[->+++<]>+.--[--->+<]>---.-------------.--[--->+<]>-.[->+++<]>+.-[->+++<]>.---[->++++<]>.-----------.++++.--------.--[--->+<]>-.---[->++++<]>.-----.[--->+<]>-----.---[----->++<]>.+++.-------.>++++++++++.--[--->++++<]>+.-[->+++<]>.+[->+++<]>.++++++.[->++++++<]>.[------>+<]>.+++.---.-[--->+<]>++.---[->+++<]>.-.-[--->+<]>-.+[->+++<]>.+++++++++.-----------.--[--->+<]>--..-.---..--.+[----->++<]>++.>++++++++++.[[-]<+]<-]  This can still be golfed further, if anyone is interested. You can test this out and confirm that it gives the correct output while meeting all of the rules. • What's this? I told you to write sentences, not random squiggles! There aren't even any words in here! – Riking Oct 25 '14 at 21:27 • Ummm.. I think the goal is to use the fewest characters. You sure won the "anti-goal" :-) – Carl Witthoft Oct 27 '14 at 12:01 ## Perl - 145 I'm happy to see so many answers! Here's a Perl solution. $s="teen-hundreds were a time for";print"The eigh$s rum. The nine$s fun.
The two-thousands are a time to run
a civilized classroom.
"for b..z


Since she hates math so much, why not Mathematica (177)

   a = "teen-hundreds were a time for "; Do["The eigh" <> a <> "rum.
The nine" <> a <> "fun.
The two-thousands are a time to run a civilized classroom." // Print, {StringLength@a}]


# Javascript ES6, 198 193 bytes

m=Math;alert("The eighteen-hundreds were a time for rum.\nThe nineteen-hundreds were a time for fun.\nThe two-thousands are a time to run\na civilized classroom.\n".repeat(~~(m.exp(m.PI)+m.E)))


Your teacher doesn't want any numbers, but since they are an english teacher, they've got no clue what Math.floor(Math.exp(Math.PI)+Math.E) means.

alert("The eighteen-hundreds were a time for rum.\n\
The nineteen-hundreds were a time for fun.\n\
The two-thousands are a time to run\na civilized\n classroom.".repeat(Math.floor(Math.exp(Math.PI)+Math.E)))


Must be run in the latest firefox

• Missing a newline at end, so the first and last rows are appended giving 75 rows – edc65 Oct 23 '14 at 16:00
• I'll award +1 for bending the rules with XKCD's reference of e^pi, but with +e as opposed to -pi... Bravo! – WallyWest Oct 24 '14 at 4:25
• -4 bytes: with(Math)alert("long string here".repeat(exp(PI)+E|[])) – nderscore Oct 24 '14 at 19:59
• Oh well, forget about Math: (q='aaaaa'.length)*q – edc65 Oct 24 '14 at 23:11
• Forget about @edc65 comment too! Use this:"\x18".charCodeAt()! (hardcode the arrow up and you will save a ton!) – Ismael Miguel Oct 25 '14 at 20:25

Javascript - 178 Bytes 176 Bytes

My first golf, thought I'd give it a shot with bit twiddling operators, didn't turn out quite as well as hoped, but oh well!

c="teen-hundreds were a time for "
b=!!c
alert(Array((b+b+b<<b+b)+b<<b).join("The eigh"+c+"rum.\nThe nine"+c+"fun.\nThe two-thousands are a time to run\na civilized classroom.\n"))


Since I'm already in detention, and obviously have troubles behaving myself... Javascript - 71 Bytes

This one will probably get me in deeper trouble, but, if I already landed myself in detention, AND I'm planning on cheating my detention, apparently I lack good judgement on how I should behave myself in class. Maybe if I can pull one over my on teacher, I can pull one over on all the other golfers out there.

b=+true;alert( Array((b+b+b<<b+b)+b<<b).join($('code')[+!b].innerHTML))  Quick! Chrome/IE 11/Firebug users, open your consoles RIGHT NOW and try it. (Please don't hurt me too much, I thought it was funny) • The 72 is fun. The 176 is many times wrong: Array(25).join() gives 24 repetitions, and a newline at end sentence is missing. All in all 24*3=72 rows instead of 100 (lazy boy!) – edc65 Oct 23 '14 at 22:26 • AUGH, ok fixed. Now 178 and 71. – Sidney Oct 23 '14 at 22:42 • You can save 2 bytes adding the t and a trailing space in "een-hundreds...for". – Luminous Oct 24 '14 at 3:19 • What is the second code doing? – justhalf Oct 24 '14 at 3:58 • @justhalf, It takes use of JQuery, a common JavaScript library that apparently the SO network utilizes. The$ is actually a function that, among many many other things, takes a lot of the work out of DOM element selection. By using $('<selector>'), which is in this case all elements with the 'code' tag, I get an object containing all elements. By using [+!b] I get the integer value of false, which is zero, so I select the 0th index, which happens to be the OP's first code block, which is in fact the teachers favorite saying. – Sidney Oct 24 '14 at 13:20 ## C# - 229 216 Bytes Free using FTW! using c=System.Console; class S{static void Main(){var a="teen-hundreds were a time";for(int b=a.Length,i=b-b;i++<b;)c.Write("The eigh"+a+" for rum.\nThe nine"+a+" for fun.\nThe two-thousands are a time to run\na civilized classroom.\n");}}  Alternative, same byte count (more usingabuse, though) using i=System.Int32; using c=System.Console; class S{static void Main(){var a="teen-hundreds were a time";for(int b=new i();b++<a.Length;)c.Write("The eigh"+a+" for rum.\nThe nine"+a+" for fun.\nThe two-thousands are a time to run\na civilized classroom.\n");}}  • ~~ (╯°□°）╯︵ ┻━┻ – William Barbosa Oct 23 '14 at 18:46 • You can add " for " to a – FryAmTheEggman Oct 23 '14 at 19:01 • @FryAmTheEggman the string is 25 characters long, he is using it to obtain the number 25 discretely. However, he can swap this method out for simply subtracting chars from each other (':'-'!' == 25), which is shorter than a.Length, and will allow for to be included as you suggest. (Alternativly, do as other answers seem to, and just loop between ! and :, funny how we all chose the same chars) – VisualMelon Oct 23 '14 at 19:47 • @VisualMelon Whoops, you're totally right. – FryAmTheEggman Oct 23 '14 at 19:57 • I thought I could since usings are not even being counted, has OP clarified this? – William Barbosa Oct 26 '14 at 14:35 # Befunge-93, 268260 256 (grid size: 72x6=432) #v"K">:!#@_v>$"enin">,,,,::-" rof emit a erew sderdnuh neet">:#,_$::!!-# , ,,,"The "<|\!\%-"\^"::%-" #":-!!: -"#-"-::$_ "hgie"^v1"two-thousands are a time to run"
$_$  "nuf"v"rum"
The two-thousands a$f to run a civilized classroom. ";  Old version: $a=a;while($a++!=z)echo"The eighteen-hundreds were a time for rum. The nineteen-hundreds were a time for fun. The two-thousands are a time to run a civilized classroom. ";  This works because php cycles the chars, and we just check if it isn't z and stop. (One curiosity is that when php reaches z, it then goes to aa.) • The general convention here is to count newlines as only one byte, unless perhaps your language is so stubborn it only accepts CRLF, which is not the case for PHP. – nyuszika7h Oct 25 '14 at 8:54 # Python 2 - 155 Note: since control characters don't show on SE, I've replaced it with \x19. a,b='\nThe ','teen-hundreds were a time for ' print(a+'eigh'+b+'rum.'+a+'nine'+b+'fun.'+a+'two-thousands are a time to run\na civilized classroom.')*ord('\x19')  Base 64 version: YSxiPScKVGhlICcsJ3RlZW4taHVuZHJlZHMgd2VyZSBhIHRpbWUgZm9yICcKcHJpbnQoYSsnZWln aCcrYisncnVtLicrYSsnbmluZScrYisnZnVuLicrYSsndHdvLXRob3VzYW5kcyBhcmUgYSB0aW1l IHRvIHJ1bgphIGNpdmlsaXplZCBjbGFzc3Jvb20uJykqb3JkKCcZJyk=  • Regarding the import, I think you could save a bit with from string import * or however it's called in Python – FireFly Oct 23 '14 at 17:25 • You can move "teen" into b. – FryAmTheEggman Oct 23 '14 at 18:48 • You can remove the [] brackets in the first line, which implicitly creates a tuple and then unpacks it. – Doorknob Oct 23 '14 at 23:51 • You can also move the ord('d')//len('aaaa') to before the string so you don't have to bracket it. – FryAmTheEggman Oct 24 '14 at 0:20 • @Dennis The OP's latest edit allows leading newlines. – Beta Decay Oct 25 '14 at 14:25 # LiveScript - 181 p=(a,b)->"The #{a}teen-hundreds were a time for #b.\n" each console.log,map (->(p \eigh \rum)+(p \nine \fun)+'The two-thousands are a time to run\na civilized classroom.'),[\A to\Y]  Required imports: {each, map} = require 'prelude-ls'  If you want to run it under Node.js, install the LiveScript (not livescript) and prelude-ls packages from npm, replace alert with console.log and run lsc prog.ls, where prog.ls contains the program. • See rules: "You cannot use the characters 0123456789" – Paul R Oct 23 '14 at 16:22 • Nice catch, fixed. – nyuszika7h Oct 24 '14 at 10:48 ## T-SQL: 206 Makes use of a cross join on five rows to generate 25 rows selecting the phrase. The line breaks are important for the output. with c as(SELECT\ N FROM(VALUES(\),($),($),($),($))A(B))SELECT REPLACE('The eigh$rum.
The nine$fun. The two-thousands are a time to run a civilized classroom.','$','teen-hundreds were a time for ')FROM c a,c b


# Bash, 151 bytes

t="teen-hundreds were a time for"
for i in {a..y};{
echo "The eigh$t rum. The nine$t fun.
The two-thousands are a time to run
a civilized classroom."
}


## C, 196 chars

This isn't an easy task for good ol' C. Factoring out the "The %steen-hundreds ..." pattern saves me a whole two characters.

Whitespace for clarity, include not counted.

#include <stdio.h>
main(){
for (char*p="The %steen-hundreds were a time for %s.\n",
*s="The two-thousands are a time to run\na civilized classroom.",
*q=p;
*q++ - 'a';
puts(s))
printf(p,"eigh","rum"), printf(p,"nine","fun");
}


# Ruby, 145

?K.upto(?c){puts"The eigh#{x="teen-hundreds we#{t="re a time "}for "}rum.
The nine#{x}fun.
The two-thousands a#{t}to run
a civilized classroom."}


# Explanation

• Use String#upto to print the lines 25 times. The range "K".."c" is 25 characters.
• Use basic String interpolation to shorten the lines.
• #{a="The "} is actually costing you more characters! #{a} is the same length as The  – Mikey Oct 23 '14 at 23:34

## Racket 173

(let([x"teen-hundreds were a time for "])(for([z(+ #xa #xf)])(displayln(~a"The eigh"x"rum.\nThe nine"x"fun.\nThe two-thousands are a time to run\na civilized classroom."))))


Ungolfed:

(let ([x "teen-hundreds were a time for "])
(for([z(+ #xa #xf)])
(displayln (~a "The eigh"x"rum.\nThe nine"x"fun.\nThe two-thousands are a
time to run\na civilized classroom."))))


# C, 215203 199 bytes

main(a){a<<='\xC'+'\xD';while(a>>=!!a)printf("The eighteen-hundreds were a time for rum.\nThe nineteen-hundreds were a time for fun.\nThe two-thousands are a time to run\na civilized classroom.\n");}


Ungolfed

main(a)
{
a<<='\xC'+'\xD';
while(a>>=!!a)
printf("The eighteen-hundreds were a time for rum.\nThe nineteen-hundreds were a time for fun.\nThe two-thousands are a time to run\na civilized classroom.\n");
}


I used bit shifting to iterate without any number.

a<<='\xC'+'\xD' sets a to 0b1[25 zeros]

a>>=!!a shifts right one bit for each time we iterate the loop

Edit : a equals argc, so its value is already 1 when the program is run with no arguments. Changed a>>='\xB'-'\xA' to a>>=!!'\xA' which is 4 bytes shorter. Also the text was displayed only 24 times. Fixed it. Removed extra brackets in the while.

Edit 2: changed !!'\xA' to !!a. Seems to work and saves 4 bytes

• You can use puts to save more bytes. – Spikatrix Jun 2 '15 at 9:58

# Rant, 191 bytes

Not the shortest solution, but still cool. I wrote a subroutine to write the first three lines, and designed it so calling it with an empty argument returned a string 25 characters long. I then pass its length to the repeater.

[pin:][$[_:a]:The [arg:a][sync:;ordered]{thousands a|teen-hundreds we}re a time ][r:[len:[$_:]]]{[step:][$_:eigh]for rum.\N[$_:nine]for fun.\N[step:][$_:two-]to run\Na civilized classroom.\N}  Ungolfed: [pin:] [$[_:a]:The [arg:a][sync:;ordered]{thousands a|teen-hundreds we}re a time ]
[r:[len:[$_:]]] { [step:] [$_:eigh]for rum.\N
[$_:nine]for fun.\N [step:] [$_:two-]to run\N
a civilized classroom.\N
}


Try it online