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
7  
I is for Illuminati – Matthew Roh 2 days ago
1  
Given some of the answers, this song by Barenaked Ladies seems relevant. – AdmBorkBork 2 days ago
1  
@JonathanAllan No slang. Dictionaries contain a lot of things that aren't technically words. Abbreviations is one, slang is another. – mbomb007 2 days ago
3  
It's too bad that this devolved into finding 3 letter words that end in the same letter. – 12Me21 2 days ago
1  
There's a couple of answers using an external dictionary. Shouldn't they have to add the size of that file to their code? – pipe yesterday

33 Answers 33

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
1  
Are lsof and xregs words? :) – OldBunny2800 2 days ago
1  
@OldBunny2800 should be fixed now – zeppelin 2 days ago
2  
I looked it up, and yes, xyst is a real word. :) – OldBunny2800 2 days ago
2  
Looks like kids are gonna be learning some big words. :D – mbomb007 2 days ago
1  
@JonathanAllan Unfortunately, man page for "x" is not available on TIO, but here is a link tio.run/nexus/…, which uses "man man" instead. The trick with xyst is that man xyst will complain that there is "No manual entry for xyst" to the stderr, which is then merged into stdout with |&, so it can be grepped. – zeppelin yesterday

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 2 days ago
    
Very smart, as ever; thanks! – Jonathan Allan 2 days ago
1  
What's Unt? Can't find that one anywhere – Albert Renshaw yesterday
    
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 yesterday
4  
@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 yesterday

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  
+1 for the word choice – Tot Zam 2 days 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 2 days 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 2 days 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 2 days ago
    
@MartinEnder Thanks. What does $& do exactly? I didn't see it on the GitHub wiki. – Business Cat 2 days ago
    
It's an alias for $0 (and it's just part of the .NET flavour, as well as most other flavours). – Martin Ender 2 days ago
    
Using some shorter words to get it down to 83, try it online – Jonathan Allan yesterday

Jelly, 39 bytes

;“ẉbẊWS»,⁸K;;”t
“¤ṁp}œḊṄæ®’b6ị“ʠȷ»ØAç"Y

TryItOnline!

Based on the 56 byte version (two below), but changed words to remove all middle letter "u"s so it can index into the dictionary word "anisole"*, which has the convenience of having the letters we need all at indexes less than six: 1:a, 2:n 3:i, 4:s, 5:o (7:l), 0:e (note the "e" on the right is at index zero [also 8 and -7 and any other number congruent to 0 mod 8]). It's also early in the dictionary so has only a two rather than the much more common three byte lookup index ("anisogamete" would also work for 2).

* The old-school name for the aromatic ether methoxybenzene, often used in perfumes.

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 Got
H is for Hat
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 Oat
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

How?

“¤ṁp}œḊṄæ®’b6ị“ʠȷ»ØAç"Y - Main link: no arguments
“¤ṁp}œḊṄæ®’             - base 250 compressed number -> 75711304811637630759
           b6           - convert to base 6 list -----------> [   2,    3,    5,    5,    1,    1,    5,    1,    4,    5,    3,    5,    1,    3,    1,    1,    1,    5,    3,    3,    2,    0,    0,    1,    0,    3]
              “ʠȷ»      -     word from Jelly's dictionary, "anisole" 
             ị          - index into that ------------------> [ "n" , "i" , "o" , "o" , "a" , "a" , "o" , "a" , "s" , "o" , "i" , "o" , "a" , "i" , "a" , "a" , "a" , "o" , "i" , "i" , "n" , "e" , "e" , "a" , "e" , "i"]
                  ØA    - get the uppercase alphabet
                    ç"  - zip with last link (1) as a dyad -> ["Ant","Bit","Cot","Dot","Eat","Fat","Got","Hat","Ist","Jot","Kit","Lot","Mat","Nit","Oat","Pat","Qat","Rot","Sit","Tit","Unt","Vet","Wet","Xat","Yet","Zit"]
                      Y - join with line feeds
                        - implicit print

;“ẉbẊWS»,⁸K;;”t - Link 1, join up the parts: Character, Two-Character-Word-Ending
;               - concatenate Character (e.g. "A") with
 “ẉbẊWS»        - the compressed string " is for" --->  "A is for"
        ,       - pair that with
         ⁸      - the left argument (Character) -----> ["A is for","A"]
          K     - join with spaces ------------------>  "A is for A"
           ;    - concatenate with right argument --->  "A is for An"
            ;   - concatenate with
             ”t -     "t" --------------------------->  "A is for Ant"

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, Use, 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 2 days ago
    
Heh, it was a lie. Xenon was the obvious one :) – Jonathan Allan 2 days ago
    
I think they are thinking of xenop, which is not in Jelly's dictionary. – Jonathan Allan 2 days ago
    
Wonderful idea! But Uut? – Greg Martin 2 days ago
    
@GregMartin I agree, I think you started devolving your words into syllabic grunts. – carusocomputing 2 days 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

Ruby, 93 84 69 63 58 62 bytes

?A.upto(?Z){|l|puts l+" is for #{"AnDoIsUn"[/#{l}./]||l+?a}t"}

Output:

A is for Ant
B is for Bat
C is for Cat
D is for Dot
E is for Eat
F is for Fat
G is for Gat
H is for Hat
I is for Ist
J is for Jat
K is for Kat
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 Unt
V is for Vat
W is for Wat
X is for Xat
Y is for Yat
Z is for Zat

All 3-letter words ending with 't', most of them with 'at'.

Using controversial words (iat, dat, amp. ump) - 55 bytes:

?A.upto(?Z){|l|puts l+" is for "+l+("AU"[l]?"mp":"at")}

Still trying to find a pattern, I think it's possible to use just 2 different endings, and simplify everything.

Thanks @Value Ink and @Business cat for helping.

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 2 days ago
    
Thanks, I was thinking about something similar but I am away from my PC now, I will definitely check that. – G B 2 days 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 2 days ago
1  
Kat is a valid word, so you can remove the special case for kit. – Business Cat yesterday
1  
I thought of "dat" and "zat" but they are both the same conjunction (that) and slang, both of which types of words are barred. "amp" and "ump" seem to be abbreviations of "ampere"/"amplify" and "umpire". "IAT" is an acronym, so that's no good either. – Jonathan Allan yesterday

///, 163 bytes

/2/ad//1/ is for /A1Add
B1B2
C1C2
D1D2
E1Eat
F1F2
G1Goo
H1H2
I1Irk
J1Job
K1Kob
L1L2
M1M2
N1Nob
O1Owl
P1P2
Q1Qat
R1R2
S1S2
T1T2
U1Use
V1Vat
W1W2
X1X-ray
Y1Yob
Z1Zoo

Try it online

Yob - n. - A cruel and brutal fellow

Hm, learned something today...

share|improve this answer
2  
In the UK a yob is a lout, a thug, or a boor; more uncouth and rowdy than cruel and brutal. – Jonathan Allan 2 days 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 yesterday

PHP, 122 124 127 120 115 bytes

Follows the "standard" <letter><filler>t structure.
I tried to come up with words that weren't used before by anyone.
If you see a word that you want me to replace, tell me.

foreach(range(A,Z)as$k=>$c)echo"$c is for $c",($b='ceaoaaei eieeouoaaei eeaei'[$k])==' '?[I=>ka,U=>ni][$c]:$b,"t\n";

The newline is represented as \n but counted as 1 byte.


Output:

A is for Act
B is for Bet
C is for Cat
D is for Dot
E is for Eat
F is for Fat
G is for Get
H is for Hit
I is for Ikat
J is for Jet
K is for Kit
L is for Let
M is for Met
N is for Not
O is for Out
P is for Pot
Q is for Qat
R is for Rat
S is for Set
T is for Tit
U is for Unit
V is for Vet
W is for Wet
X is for Xat
Y is for Yet
Z is for Zit

Weird words:

  • ikat:

    Ikat, or ikkat, is a dyeing technique used to pattern textiles that employs resist dyeing on the yarns prior to dyeing and weaving the fabric.

  • xat:

    A carved pole erected as a memorial to the dead by some Indians of western North America

  • zit:

    a pimple; skin blemish.

  • qat:

    Catha edulis (khat, qat) is a flowering plant native to the Horn of Africa and the Arabian Peninsula.

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

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 2 days ago
    
I think 05AB1E has some built in words that can be represented by 2 bytes in a string. – 12Me21 2 days ago
    
@12Me21 that's cool! ”–³”=Apple and int(–³,214)=23891 but I still don't see the correlation here. – carusocomputing 2 days ago
    
I believe this is the list: github.com/Adriandmen/05AB1E/blob/master/dictionary.py – 12Me21 2 days ago
2  
@carusocomputing Here is a more detailed description of how the compression and decompression works. – Adnan 2 days 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 2 days ago
    
Timeout running code. BAD EVAL Make sure you update your "Try it online" link. – mbomb007 2 days ago
1  
Z is for zoofilia I would seriously consider before letting my kids sing this. – zeppelin 2 days ago
    
    
For anyone doing a double-take like I did: english is not always capitalized. ;) – DLosc 2 days ago

05AB1E, 45 42 39 38 37 36 bytes

Au'Æå•à¡P°€kš¦zᮕSè)øvy¬“ÿ€ˆ€‡ ÿt“,

Try it online!

Explanation

Au pushes the uppercase alphabet.
'Æå pushes the word scenario.
•à¡P°€kš¦zᮕ pushes the base-10 number 36774474076746444766322426.
uses those digits to index into scenario.
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

Words used: ['Ant', 'Bit', 'Cot', 'Dot', 'Eat', 'Fat', 'Got', 'Hat', 'Ist', 'Jot', 'Kit', 'Lot', 'Mat', 'Nit', 'Oat', 'Pat', 'Qat', 'Rot', 'Sit', 'Tit', 'Unt', 'Vet', 'Wet', 'Xat', 'Yet', 'Zit']

33 byte version using some words I'm unsure about

Au'†Ž•4Ãðzòç•3BSè)øvy¬“ÿ€ˆ€‡ ÿt“,

Words: ['Ant', 'Bat', 'Cat', 'Dat', 'Eat', 'Fat', 'Gat', 'Hat', 'Ist', 'Jat', 'Kat', 'Lat', 'Mat', 'Nat', 'Oat', 'Pat', 'Qat', 'Rat', 'Sat', 'Tat', 'Ust', 'Vat', 'Wat', 'Xat', 'Yat', 'Zat']

share|improve this answer

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

Clojure, 159 232 bytes

Well, now it's certainly non-competing solution as it would be far easier to hardcode the words used. Putting it out there just for the sake of having correct answer (and not using others' list of words).

(mapv #(println(str(char %)" is for"(first(re-seq(re-pattern(str" "(char(+ % 32))"+\\w{3,} "))
    (reduce(fn[a b](str a(with-out-str(load-string(str "(doc "b")")))))" xyst "(map str(keys(ns-publics 'clojure.core))))))))(range 65 91))

Basically still gets all the functions defined in clojure.core namespace, but after that evaluates doc <function name> and puts it into string. After that concatenates it into one huge string (with the word xyst) and finds appropriate words from there. Should be run in Clojure REPL.

Output:

A is for arbitrary
B is for being
C is for changes
D is for determined
E is for exception
F is for failed
G is for given
H is for held
I is for items
J is for java
K is for keys
L is for lazy
M is for must
N is for notified
O is for option
P is for performed
Q is for queued
R is for returns
S is for state
T is for true
U is for uses
V is for validator
W is for were
X is for xyst
Y is for yields
Z is for zero

Old solution:

(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))
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 2 days ago
    
or, not orb, for 1 byte. – wizzwizz4 2 days ago
1  
The minimum length is 3 letters – 12Me21 2 days ago
    
@mbomb007 updated. – cliffroot yesterday

Groovy, 76 73 bytes

(edited from 76 to 73 bytes, thank you cat)

Inspired by the ruby solution:

('A'..'Z').any{i->println"$i is for ${'AntIvyUse'.find(/$i../)?:i+'at'}"}

we use any instead of each as it is shorter and all the println statements return false. For the special cases in the string, we use String.find which in groovy returns the match or null. On null we use the elvis operator ?: to return a word ending in at instead.

Prints out:

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 Kat
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

Groovy, by cheating, 77 bytes

With the risk of being lynched:

print 'http://codegolf.stackexchange.com/q/109502'.toURL().text[21796..22189]

i.e. read the data in this page and print out the definition of a valid answer at the beginning. In my defense...it does print out the requested answer...now nobody edit the page...

Groovy, using 'times', 81 bytes

Building on the python answer with the three letter word pattern:

26.times{i,c=i+65->printf"%c is for %c${'niooaauusoioaiuaaoiineeaei'[i]}t\n",c,c}

prints:

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

Groovy, using eachWithIndex, 88 bytes

'niooaauusoioaiuaaoiineeaei'.eachWithIndex{c,i->char x=i+65;println "$x is for $x${c}t"}

Groovy, using transpose, 102 bytes

['A'..'Z','niooaauusoioaiuaaoiineeaei'as List].transpose().each{println it[0]+" is for ${it.join()}t"}
share|improve this answer
    
Kat is a valid word, so you can remove the special case for kit. – Business Cat yesterday
    
edited, thank you. Saved me 3 bytes : ) – Matias Bjarland yesterday

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've now made it all the way to X but got stuck on Y; as far as I can tell, the only attainable three-letter X word is Xis, and there's no three-letter word starting with Ys.

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

share|improve this answer
    
According to Wiktionary, you could use uzi and tiz... – DLosc 2 days 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 2 days 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 yesterday
    
@DLosc I was already using piu, so that's not a problem at all :P Thanks! – ETHproductions yesterday
    
Hm. piu seems pretty borderline--wiktionary doesn't have it as English, and dictionary.com has it as più (dunno how we're considering accents for this challenge). But yeah, ys_ would be a problem. – DLosc yesterday

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 2 days ago
    
@mbomb007 was supposed to be Que I knew there was a 3 letter legal scrabble word, misspelled it. – carusocomputing 2 days ago
    
Nice words :) could be replaced with ,. – Emigna yesterday

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 2 days ago

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
    
Example output? – snail' yesterday
    
It's the same as this one: codegolf.stackexchange.com/questions/109502/… – 12Me21 yesterday

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

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

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
1  
+1 for +a+++. I like writing those :P – Poke 8 hours ago

Mathematica 93 Bytes

ToUpperCase@#<>" is for "<>Cases[WordList[],s_/; s~StringPart~1==#][[9]]&/@Alphabet[]//Column

yields

A is for abandoned
B is for babushka
C is for cabin
D is for dactylic
E is for eardrum
F is for fabricator
G is for gadabout
H is for habitation
I is for ice
J is for jackal
K is for kappa
L is for laboratory
M is for macaroni
N is for nagger
O is for oarsman
P is for pachysandra
Q is for quadratic
R is for rabidness
S is for saccharin
T is for tableland
U is for ulcer
V is for vacationist
W is for wadi
X is for xylene
Y is for yammer
Z is for zebra
share|improve this answer

Lithp, 136 125 bytes

((import lists)(each(split "niooaauusoioaiuaaoiineeaei" "")
 (scope #X,C::((print(chr(+ 65 C))"is for"(+(chr(+ 65 C))X "t")))))

(Split for readability)

Try it online!

This is pretty much a port of the Python answer

  • Saved 11 bytes by using each's index

Output:

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
2  
Great name! (I don't, thuffer from a lithp, doethe the language have thuch a thpeech ithue though?) – Jonathan Allan yesterday
    
Thank you! Nope, the language is fine with pronunciation. It's more that it's a bastardized version of Lisp. I just found Lisp far too difficult to wrap my head around, Lithp is my take on it in a way that makes sense to me. It should be much more readable than most Lisp code. – Andrakis yesterday

Python 3, 145 137 135 bytes

I sacrificed some bytes to pseudo-randomise the output with each run. The idea is to look for lowercase words of at least 3 characters in /usr/share/dict/words and then pick one from that list using id([x])%99.

import re
for x in range(65,91):print("%c is for "%x+re.findall("\n(%c.{3,})"%(x+32),open('/usr/share/dict/words').read())[id([x])%99])

Edits

  • Removed title() as words don't have to be capitalised.
  • Changed the regex to "\n(%c.{3,})" (+ 3 bytes) to allow removal of ,re.M (- 5 bytes).

Example output:

A is for abacinate
B is for bacchantic
C is for caback
D is for dactylosternal
E is for eagless
F is for factful
G is for gabbroic
H is for hackneyed
I is for iambize
J is for jacutinga
K is for kadaya
L is for labra
M is for macaco
N is for nailwort
O is for oakenshaw
P is for pachysomia
Q is for quachil
R is for racer
S is for sabbath
T is for tabulable
U is for ubication
V is for vagabondism
W is for wabe
X is for xenobiosis
Y is for yacca
Z is for zeed
share|improve this answer
    
Not sure they're all valid. For instance, I can't find a definition for Qohele, though a search reveals that it is a book or volume of sacred text. – Andrakis yesterday
1  
Just noticed that my regex doesn't match until the end of each word -- will fix. – Ductr Tape yesterday
    
Fixed it. Now only looking for lowercase, complete words to not have names in there. – Ductr Tape yesterday
    
+1, looks good to me :) – Andrakis yesterday

GNU sed, 81 + 1(r flag) = 82 bytes

This is a sed implementation of the word list from Jonathan Allan's answer.

s:$:AnBiCoDoEaFaGuHuIsJoKiLoMaNiOuPaQaRoSiTiUnVeWeXaYeZi:
s:(.).:\1 is for &t\n:g

The words, except the shared ending letter t, are given in concatenated form on line 1, and then printed in the requested format by line 2. A trailing newline is present.

Run:

sed -rf alphabet_song.sed <<< ""
share|improve this answer

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 2 days 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 2 days ago

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

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

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.