Programming Puzzles & Code Golf Stack Exchange is a question and answer site for programming puzzle enthusiasts and code golfers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Your goal is to create an alphabet song as text in the following form (in order):

A is for <word starting with A>
B is for <word starting with B>
C is for <word starting with C>
...
Z is for <word starting with Z>

Example output:

A is for Apple
B is for Banana
C is for Carrot
D is for Door
E is for Elephant
F is for Frog
G is for Goat
H is for Hat
I is for Icicle
J is for Jelly
K is for Kangaroo
L is for Lovely
M is for Mom
N is for Never
O is for Open
P is for Paste
Q is for Queen
R is for Rice
S is for Star
T is for Test
U is for Underneath
V is for Very
W is for Water
X is for X-ray
Y is for Yellow
Z is for Zipper

Rules:

  • Each "letter" of the song has its own line, so there are 26 lines, and a possible trailing linefeed.

  • The output is case-sensitive:

    • The letter at the start of each line must be capitalized.
    • is for is lowercase.
    • The chosen word does not need to be capitalized, but may be. All lines should be consistent.
  • The chosen word for each line is up to you, but must be a valid English word with at least 3 letters, and it cannot be a conjunction (like and or but), interjection/exclamation (like hey or yay), abbreviation (like XLS), or a name (like Jon).

  • Though I doubt anyone would find it shorter, I'd find it acceptable to use a phrase instead of a single word. So if for some reason S is for Something smells fishy... is shorter, go for it.

  • Put your program's output in your answer, or at least the list of words you used (if there's a link to run your code online, we don't need to see the entire output).

  • Shortest code wins


This challenge was inspired by this video.

share|improve this question
    
Is leading/trailing whitespace ok? – Business Cat 18 hours ago
    
Not leading whitespace, and no extra blank lines between the 26 lines. – mbomb007 18 hours ago
3  
I is for Illuminati – Matthew Roh 18 hours ago
1  
Given some of the answers, this song by Barenaked Ladies seems relevant. – AdmBorkBork 15 hours ago
1  
@JonathanAllan No slang. Dictionaries contain a lot of things that aren't technically words. Abbreviations is one, slang is another. – mbomb007 14 hours ago

26 Answers 26

Bash (+coreutils), 81, 87, 82, 78 bytes

Uses the man page for X, as the source of words.

Golfed

man xyst\  x|&grep -Po '\b[a-z]{4,} '|sed 's/\(.\)/\u\1 is for &/'|sort -uk1,1

EDITS

  • Used a non-existing 'xyst' man page + |& to save 5 bytes;
  • Saved 4 more bytes, by swapping sed and _sort.

Test

%man xyst\  x|&grep -Po '\b[a-z]{4,} '|sed 's/\(.\)/\u\1 is for &/'|sort -uk1,1

A is for also 
B is for build 
C is for computing 
D is for distribution 
E is for entry 
F is for following 
G is for graphics 
H is for hierarchical 
I is for implementations 
J is for just 
K is for keyboard 
L is for listing 
M is for manual 
N is for network 
O is for output 
P is for programs 
Q is for quite 
R is for runs 
S is for system 
T is for transparent 
U is for used 
V is for various 
W is for window 
X is for xyst 
Y is for your 
Z is for zeros 
share|improve this answer
    
Does the name thing apply to any names (i.e. Cities, Continents e.t.c.) or only human names ? – zeppelin 18 hours ago
1  
Are lsof and xregs words? :) – OldBunny2800 17 hours ago
1  
@OldBunny2800 should be fixed now – zeppelin 17 hours ago
1  
I looked it up, and yes, xyst is a real word. :) – OldBunny2800 17 hours ago
2  
Looks like kids are gonna be learning some big words. :D – mbomb007 17 hours ago

Python 2, 88 77 bytes

-11 bytes thanks to xnor (avoid the zip by traversing the string and counting c up from 65)

c=65
for x in'niooaauusoioaiuaaoiineeaei':print'%c is for %c%st'%(c,c,x);c+=1

Try it online!

(A port of my Jelly answer, when it was 56 bytes.)

A is for Ant
B is for Bit
C is for Cot
D is for Dot
E is for Eat
F is for Fat
G is for Gut
H is for Hut
I is for Ist
J is for Jot
K is for Kit
L is for Lot
M is for Mat
N is for Nit
O is for Out
P is for Pat
Q is for Qat
R is for Rot
S is for Sit
T is for Tit
U is for Unt
V is for Vet
W is for Wet
X is for Xat
Y is for Yet
Z is for Zit
share|improve this answer
4  
I like the method of words that end in t. The iteration can be shortened by updating x in parallel. – xnor 14 hours ago
    
Very smart, as ever; thanks! – Jonathan Allan 14 hours ago
    
What's Unt? Can't find that one anywhere – Albert Renshaw 5 hours ago
    
I don't think Unt is a word, but Ut is so you can replace the n in your literal with \0 to make this valid and only add on one more byte. Edit nevermind rules say it has to be 3 letters long... hmmm – Albert Renshaw 5 hours ago
2  
@AlbertRenshaw An unt is a European Mole according to Merriam-Webster. An alternative would be ult according to Wiktionary it is not just an abbreviation (which are listed with periods, such as ult.). – Jonathan Allan 4 hours ago

Bash, 78, 69 bytes

Aardvarks, Babushkas and Kamikazes !

Golfed

sed -nr '/^[a-z]{9}$/s/(.)/\u\1 is for &/p'</u*/*/*/words|sort -uk1,1

EDITS

  • Got rid of grep, -9 bytes

Test

%sed -nr '/^[a-z]{9}$/s/(.)/\u\1 is for &/p'</u*/*/*/words|sort -uk1,1

A is for aardvarks
B is for babushkas
C is for cablecast
D is for dachshund
E is for eagerness
F is for fabricate
G is for gabardine
H is for habitable
I is for ibuprofen
J is for jabberers
K is for kamikazes
L is for labelling
M is for macaronis
N is for nailbrush
O is for obedience
P is for pacemaker
Q is for quadrants
R is for rabbinate
S is for sabotaged
T is for tableland
U is for ulcerated
V is for vacancies
W is for wackiness
X is for xylophone
Y is for yachtsman
Z is for zealously

Makes use of /usr/share/dict/words:

words is a standard file on all Unix and Unix-like operating systems, and is simply a newline-delimited list of dictionary words. It is used, for instance, by spell-checking programs.

share|improve this answer
    
+1 for the word choice – Tot Zam 10 hours ago

PowerShell, 150 141 117 75 bytes

65..90|%{$i=[char]$_;"$i is for $i$('niooaauusoioaiuaaoiineeaei'[$_-65])t"}

Try it online!

Loops from 65 to 90 (i.e., ASCII A to Z). Each iteration, we turn the integer into the appropriate char (i.e., ASCII 65 for A), save that into $i for use later, string-concatenate that with is for $i, and then tack on the middle of the appropriate word. That's done by indexing into a lengthy string (borrowed from Jonathan Allan's answer). Finishes off with the letter t to make the three letter word.

The resulting strings are all left on the pipeline, and an implicit Write-Output at the end prints them with newlines in between.

Saved a bunch of bytes thanks to Rod
Borrowed wordlist from Jonathan Allan's answer

share|improve this answer
    
you can remove the first letter of each word (the capital one) and print with [char]$ example – Rod 18 hours ago
    
@Rod Thanks. I coupled that with what I was just working on to change how the loop is calculated and how the indexing is calculated and saved some more yet. – AdmBorkBork 18 hours ago

Retina, 89 87 bytes

Saved 2 bytes thanks to Martin Ender


ApBaCaDoEaFaGeHaIkaJeKiLeMeNeOpPeQaRaSaTiUniVaWeXysYurZi
[A-Z]
¶$& is for $&
^¶

m`$
t

Try it online!

I picked a word for each letter that ends in t (some are pretty obscure).

Explanation


ApBaCaDoEaFaGeHaIkaJeKiLeMeNeOpPeQaRaSaTiUniVaWeXysYurZi

Replace the non-existent (empty) input with the text above.

[A-Z]
¶$& is for $&

Replace each capital letter with (newline)(itself) is for (itself). This results in the text above being split into separate lines like

A is for Ap
B is for Ba
C is for Ca

... and so on

^¶
​

However, since the newline was placed before each capital, there is a leading newline that must be removed. It is removed in this stage.

m`$
t

Put a t at the end of every line, since every word used in the song ends in t.

share|improve this answer
    
You don't need to capture the upper case letter. Just use $& or $0 instead of $1. Actually that might also save bytes over my split stage. – Martin Ender 16 hours ago
    
@MartinEnder Thanks. What does $& do exactly? I didn't see it on the GitHub wiki. – Business Cat 16 hours ago
    
It's an alias for $0 (and it's just part of the .NET flavour, as well as most other flavours). – Martin Ender 16 hours ago
    
Using some shorter words to get it down to 83, try it online – Jonathan Allan 8 hours ago

Retina, 92 88 bytes

Saved 4 bytes by borrowing an idea from Business Cat's answer.

Byte count assumes ISO 8859-1 encoding.


AddBCDEelFGHItsJetKitLMNetOilPQatRSTUrnVatWXisYesZit
[A-Z]
¶$& is for $&
m` .$
$&ad
G`.

Try it online!

Based on AdmBorkBork's word list, but I've changed a few more words into ones that end in ad to save more bytes on the common suffix.

Explanation


AddBCDEelFGHItsJetKitLMNetOilPQatRSTUrnVatWXisYesZit

Turn the empty (non-existent) input into this string. It contains all the letters as well as the rest of those words which don't end in ad.

[A-Z]
¶$& is for $&

Insert a linefeed before each upper case letter and then turn it into X is for X.

m` .$
$&ad

Match the letters which are now by themselves and append ad to complete the shortened words.

G`.

Discard the empty line that was created by inserting a linefeed before A.

share|improve this answer

Jelly, 44 bytes

“€ṅp/Ạ-tṠḌœ’b8ị“ɼƒḍḞ»p”t¤ØAż,@K¥€“ẉbẊWS»ØAżY

“€ṅp/Ạ-tṠḌœ’b8ị“ɼƒḍḞ»p”t¤ØAż,@K¥€“ẉbẊWS»ØAżY - Main link: no arguments

“€ṅp/Ạ-tṠḌœ’                                 - base 250 compressed number -> 53275341476744028543531
         b8                                  - convert to base 8 list -> [1,3,2,2,0,0,7,7,4,2,3,2,0,3,7,0,0,2,3,3,1,5,5,0,5,3]
                        ¤                    - nilad & link(s) as nilad
               “ɼƒḍḞ»                        -     compressed string "noiseaura"
                      ”t                     -     ["t"]
                     p                       -     Cartesian product  -> ["nt","ot","it","st","et","at","ut","rt","at"]
              ị                              - index into -> ["nt","it","ot","ot","at","at","ut","ut","st","ot","it","ot","at","it","ut","at","at","ot","it","it","nt","et","et","at","et","it"]
                         ØAż                 - the alphabet zipped with that -> ["Ant","Bit","Cot","Dot","Eat","Fat","Gut","Hut","Ist","Jot","Kit","Lot","Mat","Nit","Out","Pat","Qat","Rot","Sit","Tit","Unt","Vet","Wet","Xat","Yet","Zit"]
                                 “ẉbẊWS»     - compressed string " is for"
                               ¥€            - last 2 links as a dyad for €ach
                            ,@               -     pair with reversed arguments
                              K              -     join with spaces (just to put the space between " is for" and the word)
                                        ØAż  - the alphabet zipped with that -> [[A"," is for Asp"],["B"," is for Bat"],...,["Z"," is for Zap"]]
                                           Y - join with line feeds
                                             - implicit print

TryItOnline!

New & improved version of the previous 56 byte version (two below), outputting:

A is for Ant
B is for Bit
C is for Cot
D is for Dot
E is for Eat
F is for Fat
G is for Gut
H is for Hut
I is for Ist
J is for Jot
K is for Kit
L is for Lot
M is for Mat
N is for Nit
O is for Out
P is for Pat
Q is for Qat
R is for Rot
S is for Sit
T is for Tit
U is for Unt
V is for Vet
W is for Wet
X is for Xat
Y is for Yet
Z is for Zit

Previous, 46

“¤ṪŻIð^ƥ’b4ị⁾sap⁾pt¤ØAż,@K¥€“ẉbẊWS»ØAżYF”e272¦

Words all have second letter "s" or "a" and last letter "p" or "t" using a base four lookup in a Cartesian product of "sa" and "pt". Except the "U" word, which the code changes to "Use" (using the relatively bulky F”e272¦ on the end) - if I could find a word list like this that does not have such an exception we'd be looking at 39 bytes.

Word list:

Asp, Bat, Cat, Dap, Eat, Fat, Gap, Hat, Ist, Jat, Kat, Lap, Mat, Nap, Oat, Pat, Qat, Rat, Sat, Tap, Usp, Vat, Wat, Xat, Yap, Zap

try this one


Previous 56 bytes

”tṁØA⁺,j“niooaauusoioaiuaaoiineeaei”œs3Z,@K¥€“ẉbẊWS»ØAżY

Word list:

Ant, Bit, Cot, Dot, Eat, Fat, Gut, Hut, Ist, Jot, Kit, Lot, Mat, Nit, Out, Pat, Qat, Rot, Sit, Tit, Unt, Vet, Wet, Xat, Yet, Zit

It is formatted, give it a go


Previous, 83 bytes

“ẉbẊWS»WṁØA⁺żż“¦ịfe$ɲVPġþ¹Øt@ƑƊŀqṁŒƑOɦ⁴ḍẊḤṁr}Ƭ¢b⁻?q&øIụNẎ9eƲi⁸'ıB.;%V,¦İ⁷ẓk½»s5¤K€Y

...let's play "Spot which letter does not have an animal!" there is one, and only one - watch out for the red herring (a lie, the red herring was xenon, which is an element, obviously not an animal), are two five letter words here that are not animals (xenon being one):

Aphid, Bison, Camel, Dingo, Eagle, Finch, Gecko, Heron, Indri, Jabot, Koala, Lemur, Mouse, Nyala, Otter, Panda, Quail, Raven, Sloth, Tapir, Urial, Viper, Whale, Xenon, Yapok, Zebra

(of course this is formatted correctly, try it - I just thought I'd save space)

share|improve this answer
    
Xenon is not an animal. I was sure you were making a joke by having H is for Herring, but I guess not. – mbomb007 16 hours ago
    
Heh, it was a lie. Xenon was the obvious one :) – Jonathan Allan 16 hours ago
    
Except... there actually is an animal called a xenon. You lied again. "Xenons: a slender-billed rain forest bird from the Americas." quora.com/What-animals-begin-with-the-letter-X – mbomb007 16 hours ago
    
I think they are thinking of xenop, which is not in Jelly's dictionary. – Jonathan Allan 16 hours ago
    
Wonderful idea! But Uut? – Greg Martin 16 hours ago

05AB1E, 72 68 bytes

Code:

”–³æéÁéî¹àæÑåê§µ™Ä‚æ†Í„΢׆™ƒÛÌ´ŸÄ«©‡¯†‚IJ‚Ò„©É€ŠÛì„”#vy¬…ÿ€ˆ€‡ð«ì,

Uses the CP-1252 encoding. Try it online!

Explanation

The following code:

”–³æéÁéî¹àæÑåê§µ™Ä‚æ†Í„΢׆™ƒÛÌ´ŸÄ«©‡¯†‚IJ‚Ò„©É€ŠÛì„”#

pushes this array:

['Apple', 'Banana', 'Carol', 'Door', 'Elephant', 'Frog', 'Goat', 'Hat', 'Ice', 'January', 'Key', 'Love', 'Mom', 'Never', 'Open', 'Paste', 'Queen', 'Rice', 'Star', 'Test', 'Underwear', 'Very', 'Water', 'Xanax', 'Yellow', 'Zoloft']

And is processed using the following code:

vy¬…ÿ€ˆ€‡ð«ì,

vy              # For each string in the array
  ¬             # Get the first letter of that string
   …ÿ€ˆ€‡       # Push the string "ÿ is for" where 'ÿ' is the first letter of the string
         ð«     # Append a space character
           ì    # Prepend this string to the current string from the array
            ,   # Print with a newline
share|improve this answer
    
Can you explain why that pushes that array? – carusocomputing 17 hours ago
    
I think 05AB1E has some built in words that can be represented by 2 bytes in a string. – 12Me21 16 hours ago
    
@12Me21 that's cool! ”–³”=Apple and int(–³,214)=23891 but I still don't see the correlation here. – carusocomputing 15 hours ago
    
I believe this is the list: github.com/Adriandmen/05AB1E/blob/master/dictionary.py – 12Me21 15 hours ago
2  
@carusocomputing Here is a more detailed description of how the compression and decompression works. – Adnan 15 hours ago

///, 165 bytes

/2/ad//3/at//1/ is for /A1Add
B1B3
C1C3
D1D2
E1E3
F1F2
G1G3
H1H3
I1Irk
J1Job
K1Kob
L1L2
M1M2
N1Nob
O1Owl
P1P2
Q1Q3
R1R2
S1S2
T1T2
U1Use
V1V3
W1W2
X1X-ray
Y1Yob
Z1Zoo

Try it online

Yob - n. - A cruel and brutal fellow

Hm, learned something today...

share|improve this answer
    
@ETHproductions Thanks, yes it would. Fixed now... – steenbergh 16 hours ago
2  
In the UK a yob is a lout, a thug, or a boor; more uncouth and rowdy than cruel and brutal. – Jonathan Allan 15 hours ago
1  
In Russian "Yob" is a shortened past form of obscene verb, which, basically, is an equivalent of "f*ck" in English. The more you know... – Mr Scapegrace 2 hours ago

Pyke, 55 51 48 bytes

26.f[1R].C".d"R+E)DGjt@.^.Il 6>( F['h .dRdJl5

Try it here!

Link is for 3 length and doesn't qualify as words include conjunctives.

    [1R].C".d"R+E)                            - def function [i):
     1R]                                      -     [1, i]
        .C                                    -    chr(^)
          ".d"R+                              -   ".d"+ ^
                E                             -  eval(^) (dictionary lookup of length 1)
                                              -    gets the `i`th word in the dictionary

26.f[             DGjt@.^.Il 6>(              -  first_26():
    [                                         -     function(i)
                       .^                     -    ^.startswith(v)
                   Gjt@                       -     alphabet[current_iter-1]
                         .Il 6>               -   if ^:
                           l 6>               -    len(function(i)) > 6
                                 F['h .dRdJl5 - for i in ^:
                                  ['h         -     function(i)[0], function(i)
                                      .d      -    "is for" (unprintables 0x02, 0x07, 0x06)
                                        R     -    rotate(^, ^^)
                                         dJ   -   " ".join(^)
                                           l5 -  ^.capitalize()

Outputs:

A is for available
B is for because
C is for community
D is for download
E is for english
F is for features
G is for getting
H is for hardware
I is for increase
J is for jewelry
K is for kitchen
L is for locations
M is for manufacturer
N is for northern
O is for outdoor
P is for protein
Q is for quickly
R is for religion
S is for surgery
T is for thousands
U is for universal
V is for vehicles
W is for weekend
X is for xenical
Y is for youngest
Z is for zoofilia

You can test this outside of Pyke using same algorithm. Requires dictionary.json.

import json, string

with open("dictionary.json") as f_obj:
    words=json.load(f_obj)

rtn=[]
i=0
while len(rtn) != 26:
    cur_word=words[i]
    if cur_word[0]==string.lowercase[len(rtn)]:
        if len(cur_word) > 6:
            rtn.append(cur_word)
    i += 1

for i in rtn:
    print("{} is for {}".format(i[0].upper(), i))
share|improve this answer
    
No. Also, I get an error running your code. – mbomb007 14 hours ago
    
Timeout running code. BAD EVAL Make sure you update your "Try it online" link. – mbomb007 14 hours ago
    
@mbomb007 the link seems to work fine for me although it's running an invalid piece of code; the current version does indeed time out online – muddyfish 14 hours ago
    
Z is for zoofilia I would seriously consider before letting my kids sing this. – zeppelin 14 hours ago
    

Ruby, 93 84 69 bytes

puts (?A..?Z).map{|l|l+" is for #{"AntIvyKitUse"[/#{l}../]||l+"at"}"}

According to wordhippo, there are 22 3-letter words ending in "at". The most common ending in /usr/share/dict/words is 'ay', but I could get only 16 after checking wikipedia.

6 bytes saved thanks @Value Ink

Output:

A is for Ant
B is for Bat
C is for Cat
D is for Dat
E is for Eat
F is for Fat
G is for Gat
H is for Hat
I is for Ivy
J is for Jat
K is for Kit
L is for Lat
M is for Mat
N is for Nat
O is for Oat
P is for Pat
Q is for Qat
R is for Rat
S is for Sat
T is for Tat
U is for Use
V is for Vat
W is for Wat
X is for Xat
Y is for Yat
Z is for Zat
share|improve this answer
1  
Qat and Xis (plural of Xi) are words, so you can use them and also reduce your lookup regex to /#{l}../ – Value Ink 15 hours ago
    
Thanks, I was thinking about something similar but I am away from my PC now, I will definitely check that. – G B 15 hours ago
    
Actually I was trying to find some 5 letter words for the missing letters: array, essay, inlay... But I am stuck on that. :-( – G B 14 hours ago

Clojure, 159 bytes

(mapv #(println(str(char %)" is for "(some(fn[a](and(=(.charAt a 0)(char(+ % 32)))a))(conj(map str(keys(ns-publics 'clojure.core)))"orb""yes"))))(range 65 91))

Uses functions defined in clojure.core namespace (+ orb and yes words). I am not 100% sure that it complies totally to the rules so I'll let the author decide. (Admittedly it might be hard to sing it)

See it online

A is for atom
B is for bit-set
C is for chunk-first
D is for decimal?
E is for ensure
F is for find-ns
G is for get-thread-bindings
H is for hash-ordered-coll
I is for iterator-seq
J is for juxt
K is for keep-indexed
L is for line-seq
M is for macroexpand
N is for ns-unmap
O is for orb
P is for primitives-classnames
Q is for quot
R is for restart-agent
S is for sort-by
T is for tree-seq
U is for unchecked-remainder-int
V is for vswap!
W is for when-first
X is for xml-seq
Y is for yes
Z is for zipmap
share|improve this answer
5  
Several of those aren't English words. ns, vswap, xml, zipmap, macroexpand, quot, seq, juxt, coll. Plus, the hyphens wouldn't really work either. – mbomb007 17 hours ago
    
or, not orb, for 1 byte. – wizzwizz4 13 hours ago
1  
The minimum length is 3 letters – 12Me21 12 hours ago

05AB1E, 77 bytes

•‹T1qA‹rËöf#ùqÈ$>M©ÈñM£r°§°Ü]€¡3¸/©#bÍ'ò7DÉø½D—¹û©˜Òו36B3ôvy™¬"ÿ is for ÿ"}»

Try it online!

Uses the following string compressed:

ASSBINCATDOTEATFATGOTHATILLJOTKITLOTMETNOTOATPATQUEROTSETTITUSEVATWETXISYIPZAP

Converted to Base-214:

‹T1qA‹rËöf#ùqÈ$>M©ÈñM£r°§°Ü]€¡3¸/©#bÍ'ò7DÉø½D—¹û©˜Ò×

Used a list of 3-letter scrabble words: http://wordfinder.yourdictionary.com/letter-words/3

Output is as follows:

A is for Ass
B is for Bin
C is for Cat
D is for Dot
E is for Eat
F is for Fat
G is for Got
H is for Hat
I is for Ill
J is for Jot
K is for Kit
L is for Lot
M is for Met
N is for Not
O is for Oat
P is for Pat
Q is for Que
R is for Rot
S is for Set
T is for Tit
U is for Use
V is for Vat
W is for Wet
X is for Xis
Y is for Yip
Z is for Zap

Had a 70 byte version, but 2-letter words aren't allowed.


Explained:

•‹T1qA‹rËöf#ùqÈ$>M©ÈñM£r°§°Ü]€¡3¸/©#bÍ'ò7DÉø½D—¹û©˜Òו # Compressed String

36B3ô                   # Decompress, split into 3s.
     v               }  # For each word...
      y™¬"ÿ is for ÿ"   # Take first letter of word, interpolate.
                      » # Print with newlines.
share|improve this answer
    
qui is not an English word. Looking this up reveals only a Latin word. – mbomb007 14 hours ago
    
@mbomb007 was supposed to be Que I knew there was a 3 letter legal scrabble word, misspelled it. – carusocomputing 14 hours ago
    
Nice words :) could be replaced with ,. – Emigna 2 hours ago

JavaScript (ES6), 82 bytes

_=>btoa`pb
è¡Záî"Âh*"è1£b:ãÚA¤hJ$âRu^YåÚaæb`.replace(/(.)./g,`$1 is for $&t
`)

An anonymous function returning a string. Contains unprintables; here's a version that doesn't:

_=>btoa`\x02pb
\x80è\x11¡Z\x18áî"Âh*"è1£b:ãÚA¤hJ$âRu^YåÚaæb`.replace(/(.)./g,`$1 is for $&t
`)

This uses @JonathanAllen's technique, using only three-letter words that end in t. The string decompresses to AnBiCoDoEaFaGOHuIsJoKiLoMaNiOuPaQaRoSiTiUnVeWeXaYeZi.

I tried chaining two-letter pairs like so:

Ace
 Bee
  Cee
   Dew
    Ewe
     ...

I made it all the way to W but got stuck on X; as far as I can tell, the only valid three-letter X words are Xis and Xat, the only W-words leading into either of these are Wha and Wai, the only V-word there is Via, and no U-word ends in an i.

For the record, the full string was ceeeweeereueaebiuaheteee...

share|improve this answer
    
According to Wiktionary, you could use uzi and tiz... – DLosc 11 hours ago
    
@DLosc Great idea. Then you'd have to do sei, ski, or sri, which leaves you with ree, roe, rue, rye, which leaves you with... the only three letter q-words I can find are qat, qis, and qua. Is there a Wiktionary page with more three-letter words? – ETHproductions 10 hours ago
    
There's a category for three-letter words, but it isn't a complete list. For instance, it doesn't contain que (which I only know about because another answer here used it). (Not sure there's a p-word that ends with u, though.) – DLosc 2 hours ago

Japt, 52 50 bytes

Collaborated with @ETHproductions

;B£[R`  f `Od"¥¥º"gY]qXÃx

Contains many unprintables. Test it online!

The word list is:

All Bar Can Dan Ear Fan Gas Has Ill Jar Kit Led Man Nit Oar Pan Qat Rat Sat Tan Udo Vat War Xis Yes Zit

Japt uses the shoco string compression library, which reduces common runs of lowercase letters into by a byte. Here is a full list of all two-letter runs that are condensed into one byte:

an,ar,as,at,be,bl,bo,bu,ca,ce,ch,co,da,de,di,do,ed,en,er,es,ha,he,hi,ho,im,in,is,it,le,li,ll,ly,ma,me,mi,mo,nd,ne,ng,nt,of,on,or,ou,ra,re,ri,ro,se,sh,si,st,te,th,ti,to,ul,ur,us,ut,wa,we,wh,wi

So the idea is to form a word with one of these pairs for each letter of the alphabet.

;B£   [R`  f `    Od"string"gY]qXÃ x
;BmXY{[R" is for "Od"string"gY]qX} x

;                                      // Among other things, set B to "ABC...XYZ".
 B                                     // Split B into chars.
    mXY{                           }   // Map each item X and index Y to the following:
                      "string"gY       //   Take the char at index Y in the compressed str.
                    Od                 //   Decompress.
        [R" is for "            ]      //   Put this in an array with a newline and " is for ".
                                 qX    //   Join on X, giving "\n{X} is for {word}".
                                    x  // Trim. This removes the leading newline.
                                       // Implicit: output result of last expression

One interesting thing to note is that while Japt can implicitly decompress a string wrapped in backticks, that's actually a byte longer here because you'd have to grab two chars in the decompressed string, rather than one.

share|improve this answer

SmileBASIC, 131 113 82 81 bytes

FOR I=1TO 26L$=CHR$(I+64)?L$;" is for ";L$;@niooaauusoioaiuaaoiineeaei[I];"t
NEXT

Now using words that in t

share|improve this answer

Python 2, 143 bytes

import re
for i in range(26):print chr(i+65)+" is for",re.search("\W(%s\w\w+)"%chr(i+97),";jam;key;way;yes;".join(dir(__builtins__))).group(1)

Output:

A is for abs
B is for basestring
C is for callable
D is for delattr
E is for enumerate
F is for file
G is for getattr
H is for hasattr
I is for input
J is for jam
K is for key
L is for len
M is for map
N is for next
O is for object
P is for pow
Q is for quit
R is for range
S is for set
T is for tuple
U is for unichr
V is for vars
W is for way
X is for xrange
Y is for yes
Z is for zip
share|improve this answer
4  
The words chosen need to be English words. So unichr, getattr, etc are not. – mbomb007 15 hours ago

stacked, 72 bytes

There are two for 72 bytes!

65@i$'niooaauusoioaiuaaoiineeaei'{!i#::' is for '+\n+'t'+ +out i 1+@i}"!
{!n#::' is for '+\'niooaauusoioaiuaaoiineeaei'n 65-#+'t'+ +out}65 90 for

Try it online! Using that awesome pattern. (Before you ask, ++ would be a single token, so + + is used instead.)

Both work by iterating from 65 to 90 and getting the correct character sequence. Notes:

  • #: is an alias for chr
  • # is an alias for get
  • {!...} is the same as { n : ... } (lambda with n as an parameter)

For 73 bytes:

'niooaauusoioaiuaaoiineeaei'toarr{e i:65 i+#::' is for '+\e+'t'+ +out}map
share|improve this answer

05AB1E, 45 42 bytes

Uses the list of 3-letter words ending with t.

Au•4§¢PaÙÙçø&áxýó;=7ú•36Bl)øvy¬“ÿ€ˆ€‡ ÿt“,

Try it online!

Explanation

Au pushes the uppercase alphabet.
•4§¢PaÙÙçø&áxýó;=7ú• pushes the base-10 number 19009998932207203024058111616978231055914 36Blconverts that to lowercase base-36 giving niooaauusoioaiuaaoiineeaei
zips those strings together into the list [An, Bi, Co, ..., Zi]

v                  # for each element in the list
 y                 # push it
  ¬                # push it's first letter
   “ÿ€ˆ€‡ ÿt“      # push the string "ÿ is for ÿt" 
                   # replacing ÿ with with the top element of the stack
             ,     # print with newline
share|improve this answer

Mathematica, 97 bytes

a@c_:={ToUpperCase@c," is for ",Select[WordList[],#~StringTake~1==c&][[3]],"
"};a/@Alphabet[]<>""

Looks in Mathematica's WordList for the third word beginning with each letter; this avoids one-letter words and interjections. Has a trailng newline.

A is for aardvark
B is for babble
C is for cabala
D is for dabbled
E is for eagerly
F is for fable
G is for gabble
H is for haberdashery
I is for iambus
J is for jabberer
K is for kaleidoscope
L is for label
M is for mac
N is for nacelle
O is for oak
P is for pabulum
Q is for quackery
R is for rabbinate
S is for sable
T is for tabbouleh
U is for udder
V is for vacant
W is for wad
X is for xenophobic
Y is for yachting
Z is for zapper
share|improve this answer
    
eep, totally forgot, thanks – Greg Martin 14 hours ago

Python 2.X, 147 bytes

Yet another try in python using nltk -

from nltk.corpus import*;k=lambda y:filter(lambda x:y in x[0],words.words());print'\n'.join([chr(i)+' is for '+k(chr(i))[64]for i in range(65,91)])

Output -

A is for Abranchiata
B is for Baconic
C is for Cahokia
D is for Damara
E is for Echium
F is for Fascista
G is for Galenic
H is for Halawi
I is for Ichthyornithidae
J is for Jamaica
K is for Kanauji
L is for Lahontan
M is for Macropodinae
N is for Nankingese
O is for Odelsthing
P is for Palaeeudyptes
Q is for Quintius
R is for Rambo
S is for Sac
T is for Tagula
U is for Ulyssean
V is for Vanguardist
W is for Wallon
X is for Xiphodontidae
Y is for Yazoo
Z is for Zea

Ungolfed

from nltk.corpus import*
k=lambda y:filter(lambda x:y in x[0],words.words())
print'\n'.join([chr(i)+' is for '+k(chr(i))[27]for i in range(65,91)])
share|improve this answer
    
I'm pretty sure some of those are names, like Rambo. – mbomb007 12 hours ago
    
@mbomb007 I used words corpus but brown corpus can also be used and it is quite better for this problem (but its really yuge). Btw Rambo is actually a word haha - dictionary.cambridge.org/dictionary/english/rambo – hashcode55 11 hours ago

Batch, 250 bytes

@set s=ABCDEFGHIJKLMNOPQRSTUVWXYZ
@for %%w in (eon dellium zar jinn lbow hon nat our rk unta not lama nemonic domo uija sycho uay ye ee sunami rn ex rap enophobe ou ugzwang)do @call:c %%w
@exit/b
:c
@echo %s:~0,1% is for %s:~0,1%%1
@set s=%s:~1%

Since I was never going to get a decent score, I went for the shortest humorous words that I could find:

A is for Aeon
B is for Bdellium
C is for Czar
D is for Djinn
E is for Elbow
F is for Fhon
G is for Gnat
H is for Hour
I is for Irk
J is for Junta
K is for Knot
L is for Llama
M is for Mnemonic
N is for Ndomo
O is for Ouija
P is for Psycho
Q is for Quay
R is for Rye
S is for See
T is for Tsunami
U is for Urn
V is for Vex
W is for Wrap
X is for Xenophobe
Y is for You
Z is for Zugzwang
share|improve this answer

Python 2, 112 bytes

for x in range(26):y=chr(x+65);print y+' is for '+y+'naaoaaeaneieaiaaaaairaeeei'[x:x+1]+('t','n')[x in(8,20,23)]

Try it online!

All of the words end with 't' except for 3 which end with 'n' so we just store the middle letters of the three letter words and indexes of the 3 'n' words and sort out the 'misfits' at the end.

share|improve this answer

PHP + YALM, 122 bytes

This requires YALM installed because NIS(YP) doesn't come with PHP anymore and couldn't find a version where it works.
It should work by default on PHP5.0.4, but can't.

Without YALM, there are no functions starting with Y.

$F=get_defined_functions();foreach(range(a,z)as$c)foreach($F[internal]as$f)if($f[0]==$c){echo$c^' '," is for $f\n";break;}

The output:

A is for addslashes
B is for bcadd
C is for class_exists
D is for define
E is for each
F is for func_num_args
G is for get_class
H is for hash
I is for interface_exists
J is for jdtogregorian
K is for ksort
L is for localtime
M is for method_exists
N is for nl2br
O is for ob_gzhandler
P is for property_exists
Q is for quotemeta
R is for restore_error_handler
S is for strlen
T is for trait_exists
U is for user_error
V is for vprintf
W is for wordwrap
X is for xml_parser_create
Y is for yalm_parse
Z is for zend_version

The output here is machine-dependant. On this one, vprintf ended up before var_dump.
Any "non-words" are abreviated within the function name, and aren't that obscure.

This was generated with http://sandbox.onlinephpfunctions.com/ (PHP 7.0.1).
Since that doesn't have YALM, I had to manually add it in there.

share|improve this answer
    
Clever solution I was going to do something similar, glad to see this! +1 – Albert Renshaw 11 hours ago
1  
These aren't english words.... – Conor O'Brien 11 hours ago
    
@ConorO'Brien Are you sure? PHP is all written in English, as far as I know. – Ismael Miguel 11 hours ago
3  
@IsmaelMiguel things like vprintf and zend_version are most certainly not english words. Very few of these entities are actually words. – Conor O'Brien 10 hours ago
    
I think those are in english... – Ismael Miguel 1 hour ago

Befunge-93, 73 bytes

This just uses three-letter words, where the last letter is always t.

naaoaauanoioaefeauoosaeaei:0\55+\"t"\:0g\"A"+:," rof si ">:#,_$1+:55*`#@_

Try it online!

But with an additional two bytes, we can vary the last letter between t and e and get a more interesting selection.

teuowaeocoaooudouaeosaoaei:"A"+:,0" rof si ">:#,_$,:0g,1+:2%0g,55+,:55*`#@_

Try it online!

share|improve this answer

Java 7, 124 bytes

String c(){String r="";for(char a=65,i=0;i<26;r+=a+" is for "+a+++"baaonaiineioaeaoaaeileeaoi".charAt(i++)+"t\n");return r;}

Based on @JonathanAllen's answer, since Java has no fancy built-in dictionary. ;) I tried to find another ending letter for the entire alphabet (like s or n or y), or a middle letter (like a or e), but most were missing just one or two words, so I ended up using t as well. Words are manually chosen from wordhippo.com.

Ungolfed:

Try it here.

class M{
  static String c(){String r="";for(char a=65,i=0;i<26;r+=a+" is for "+a+++"baaonaiineioaeaoaaeileeaoi".charAt(i++)+"t\n");return r;}

  public static void main(String[] a){
    System.out.println(c());
  }
}

Output:

A is for Abt
B is for Bat
C is for Cat
D is for Dot
E is for Ent
F is for Fat
G is for Git
H is for Hit
I is for Int
J is for Jet
K is for Kit
L is for Lot
M is for Mat
N is for Net
O is for Oat
P is for Pot
Q is for Qat
R is for Rat
S is for Set
T is for Tit
U is for Ult
V is for Vet
W is for Wet
X is for Xat
Y is for Yot
Z is for Zit
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.