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

Perl, 140 139

improving on chilemagic answer. feature say for 3 bytes, text redundancy for 3 bytes.

$r="re a time";$s="teen-hundreds we$r for";say"The eigh$s rum.
The nine$s fun. The two-thousands a$r to run
a civilized classroom."for b..z

• You can move the r into $e as well to save another byte. – hmatt1 Oct 24 '14 at 22:08 • @chilemagic duh, thanks! missed that somehow. Under 140 now! – Matija Nalis Oct 24 '14 at 22:44 GML (Game Maker Language), 169 a="teen-hundreds were a time for "b="The eigh"+a+"rum#The nine"+a+'fun#The two-thousands are a time to run#a civilized classroom#"c=b+b+b+b+b;d=c+c+c+c+c;show_message(d)  LATEX 239 226 The byte count does not include the \documentclass command nor any \usepackage commands. I would argue both count as using external packages, as the former includes definitions in an external .cls file, and usepackage is practically synonymous with an include statement. Output is a pdf file containing the 100 lines with no other text, formatted appropriately. Try it at writelatex.com! \begin{document}\newcounter=\def\_{re a time }\def\-{een-hundreds we\_}\StrLen\-[\b]\forloop=\parindent{\value=<\b}{The eight\-for rum.\\The ninet\-for fun.\\The two-thousands a\_to run\\a civilized classroom.\\}\end{document}  Ungolfed: \documentclass{letter} \usepackage{forloop} \usepackage{parskip} \usepackage{xstring} \usepackage{nopageno} \begin{document} \newcounter= \def\_{re a time } \def\-{een-hundreds we\_} \StrLen\-[\b] \forloop=\parindent{\value=<\b}{ The eight\-for rum.\\ The ninet\-for fun.\\ The two-thousands a\_to run\\ a civilized classroom.\\ } \end{document}  Edit: New and improved. Also made link go to read-only version of code. Thank you Dennis! • 1. You should link to the read-only version of your document. I accidentally modified it (but undid all changes). 2. You can save a few bytes by eliminating whitespace and curly brackets : \begin{document}\newcounter=\def\_{re a time }\def\-{een-hundreds we\_}\StrLen\-[\b]\forloop=\parindent{\value=<\b}{The eight\-for rum.\\The ninet\-for fun.\\The two-thousands a\_to run\\a civilized classroom.\\}\end{document} – Dennis Oct 26 '14 at 14:18 • Suggested changes made, thank you for the tips. – wwarriner Oct 26 '14 at 16:34 • You're over-optimizing it. It would be much shorter if you did it like my plainTeX solution. :P – nyuszika7h Oct 27 '14 at 13:53 • Interesting, thanks. Rather than modify my answer, I'm going to upvote yours! Cheers! – wwarriner Oct 27 '14 at 15:55 • Looks like mine is currently invalid though, I overlooked the #1s. :/ – nyuszika7h Oct 27 '14 at 16:29 TeX - 169 \def\s{teen-hundreds were a time for }\def\p{The eigh\s rum. nine\s fun. The two-thousands are a time to run a civilized classroom. }\def\m{\p\p\p\p\p}\m\m\m\m\m\bye  Note that the blank lines are intentional and actually required for the output to be properly formatted. • It's fixed now. :) – nyuszika7h Oct 27 '14 at 18:12 Golfscript - 139 134 'TeighYrum.TnineYfun.Ttwo-thousands aRto run a civilized classroom.''# '{-}**'Y'/'teen-hundreds weRfor '*'T'/' The '*'R'/'re a time '*  Teacher: Joshy * , are you hashtagging in class again? Two weeks detention! #howdoesthatfeel * name preserved to protect idensity EDIT: Found shorter code. PHP - 157 $f='re a time';$r="teen-hundreds we$f for";echo str_repeat("The eigh$r rum.\nThe nine$r fun.\nThe two-thousands a$f to run\na civilized classroom.\n",aa^SU);  • Use $s instead of $string to save on quite a few bytes. – Mark Gabriel Oct 24 '14 at 11:41 • If you want to use str_repeat, use this: $f='re a time';$r="teen-hundreds we$f for";echo str_repeat("The eigh$r rum.\nThe nine$r fun.\nThe two-thousands a$f to run\na civilized classroom.\n",aa^SU); (hardcode the \n to save bytes.) and you have a 153 byte long answer! (aa^SU is 24, which is the same as (a^S)*10+(a^U) which is (2*10)+4) I based the divisions on my code. Please, present a bytecount next time and try to golf it further. – Ismael Miguel Oct 25 '14 at 19:12 • Please update the byte count when you update the answer. You can use mothereff.in/byte-counter, make sure there's no empty line at the end. Also, this can be golfed futher by removing the spaces around the = and the newline after classroom.";. – nyuszika7h Oct 28 '14 at 12:06 Perl - 152 146 bytes $_="-hundreds were a time for";say"The eighteen$_ rum.\nThe nineteen$_ fun.\nThe two-thousands are a time to run\na civilized classroom.\n"x y///c


This makes use of perl's string repetition operator and exploits a substring of length 25.

Ungolfed version:

The nine$x for fun. The two-thousands are a time to run a civilized classroom. """*x.size()  Cobra - 194 class P def main print ('[n="\nThe "]eigh'+(p='teen-hundereds we[m="re a time "]for ')+'rum.[n]nine[p]fun.[n]two-thousands a[m]to run\na civilized classroom.\n').repeat(c'S'to int-c':'to int)  Haskell (210 192 chars) My code is fairly simple: import Data.Char i x y="The "++x++"teen-hundreds were a time for "++y++".\n" main=putStr.unlines.replicate(ord '\EM')$(i"eigh""rum"++i"nine""fun"++"The two-thousands are a time to run\na civilized classroom.")


Joins a 25x replicated list of the desired string and prints it. (\EM is ASCII 25)

Edit

Updated score to omit import and trailing newline from count.

PowerShell

Count = 203 199

$c,$d,$e,$f,$g,$h,$i,$j=("The,eigh, for ,rum.,nine,fun., to run, a time"-split",");$a="teen-hundreds were$j";[char[]]$a|%{"$c $d$a$e$fn$c$g$a$e$hn$c two-thousands are$j$ina civilized classroom."}


Explanation

# Chop up this string of repeated words/phrases
$c,$d,$e,$f,$g,$h,$i,$j=("The,eigh, for ,rum.,nine,fun., to run, a time"-split",");

# Steal everyone else's idea to get 25 chars exactly
$a="teen-hundreds were$j";

# Cast to char array and pipe into foreach
[char[]]$a|%{...} # Spell everything out "$c $d$a$e$fn$c$g$a$e$hn$c two-thousands are$j$ina civilized classroom."


Groovy : 167 chars

a="teen-hundreds were a time for"
b="two-thousands are a time "
The nine$h fun. The two-thousands are a time to run a civilized classroom. """*f)  • Run with scala golf.scala – triggerNZ Oct 28 '14 at 5:20 T-SQL - 177 Using the string from the other T-SQL answer here. PRINT(REPLICATE(REPLACE('The eigh$rum.
The nine$fun. The two-thousands are a time to run a civilized classroom.','$','teen-hundreds were a time for '),ASCII('K')/LEN('AAA')))


Okay, this should properly follow the rules this time, silly me. I had almost completely forgotten about the super convenient REPLICATE function. ASCII('K') gives us 75, dividing that by LEN('AAA') which is 3 gives us the 25 we need. I could've used the character with the ASCII value 25, but having a control character seems like a bit of a cop out to me.

C99: 211

Doubt I'll be winning any prizes any time soon:

main(){char*s="The %steen-hundreds were %s for %s.\n",*t="a time",c='A';for(;c<'Z';++c){printf(s,"eigh",t,"rum");printf(s,"nine",t,"fun");printf("The two-thousands are %s to run\na civilized classroom.\n", t);}}

• Golf it more by removing #include <stdio.h> and using main(){...} instead of void main(){...}. Also, char *s="..." can be written as char*s="..." to save one byte. Declaring c outside the loop an also save some more bytes:char*s="...",c; – Spikatrix Jun 3 '15 at 5:47
• @CoolGuy All done, and I went one better by stripping the first part of the for out and assigning c at the point it is declared. I considered switching the for to a while, but it would be a byte longer. e.g. while(c<'Z'){++c;} (18) vs for(;c<'Z';++c){} (17) – Pharap Jun 3 '15 at 15:17

Perl 6, 147 bytes

my $t="teen-hundreds were a time for";say "The eigh$t rum.
The nine\$t fun.
The two-thousands are a time to run
a civilized classroom." for 'a'..'y'


Try it online!

• 'a'..'y' -> ^㉕ :P since it looks like unicode numbers are fine – ASCII-only Apr 16 at 12:19
• 140? – ASCII-only Apr 16 at 12:24

Forth (gforth), 174 bytes

: x ." teen-hundreds were a time for ";
: f bl true cell+ do ." The eigh"x .\" rum.\nThe nine"x .\" fun.\nThe two-thousands are a time to run\na civilized classroom.\n"loop ;


Try it online!

Code Explanation

: x                                      \ start a new word definition
." teen-hundreds were a time for "     \ outputs "teen-hundreds were a time for "
;                                        \ end word definition

: f                                      \ start a new word definition
bl                                     \ ascii value of space (32)
true cell+                             \ true (-1) + size of cell (8 in 64-bit) = 7
do                                     \ counted loop from 7 to 31 (total of 25)
." The eigh"x                        \ output "The eigh" and call x
.\" rum.\nThe nine"x                 \ output "rum\nThe nine" and call x
.\" fun.\nThe two-thousands are a time to run\na civilized classroom.\n" \ output the rest
loop                                   \ end loop
;                                        \ end word definition


EXCEL , 160 164 bytes

asked Teacher if I could use Excel, Teacher said Yes.

asked Teacher if I could click around, Teacher said Yes.

So click Wrap Text, merge A-TwentyFive to A-OneHundredTwentyFive and Paste this in Cell A-TwentyFive

=REPT("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.
",ROW())

• I count this as 164, did I miss something? – Origin Apr 16 at 8:18
• I'm using TIO to count the bytes of my code. are you referring to the New Line? maybe its not counting it. will add it. Thank you :) – remoel Apr 16 at 8:41