Create an Alphabet Song

55

5

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.

mbomb007

Posted 2017-02-08T15:23:36.770

Reputation: 21 944

I am guessing slang is not allowed, even if listed in proper dictionaries? (e.g. "When she realised she was headed towards the outback again she just pulled a uey!")

– Jonathan Allan – 2017-02-08T19:06:17.433

1

Given some of the answers, this song by Barenaked Ladies seems relevant.

– AdmBorkBork – 2017-02-08T19:21:30.437

1@JonathanAllan No slang. Dictionaries contain a lot of things that aren't technically words. Abbreviations is one, slang is another. – mbomb007 – 2017-02-08T19:34:41.867

@AdmBorkBork This challenge was inspired by this video.

– mbomb007 – 2017-02-08T19:36:05.230

4It's too bad that this devolved into finding 3 letter words that end in the same letter. – 12Me21 – 2017-02-09T00:33:52.940

@12Me21 how is that devolution, is this not code-golf?! If you can find a way to access longer words with fewer bytes just do it! Edit - Find a list of 3-letter words using a set of two middle letters and a set of two end letters and you can beat the single enders (which use a set of seven middles). – Jonathan Allan – 2017-02-09T12:32:03.803

@12Me21 Just because other people are copying each other's methods doesn't mean that there isn't a better one yet to be found. – mbomb007 – 2017-02-09T14:36:13.187

1There's a couple of answers using an external dictionary. Shouldn't they have to add the size of that file to their code? – pipe – 2017-02-09T15:30:35.697

@pipe Like which? The ones using the Linux words file? I'm not sure. What's the meta consensus? Idk, because if you think about Python modules, each one is really a different file, but the Linux file is OS dependent, so that might be an external source, not part of the language. – mbomb007 – 2017-02-09T19:53:41.407

If X is for X-ray is allowed (where X is not a word, but just represents the common letter for an unknown in algebra) and S is for Something smells fishy... is also allowed, would X is for X is a letter be allowed? – hmakholm left over Monica – 2017-02-11T19:03:07.857

No. X-ray is a single word, just like twenty-two is a word. Learn your English. – mbomb007 – 2017-02-11T20:07:30.820

Relevant? – HyperNeutrino – 2017-04-10T20:10:05.387

Answers

3

SOGL 0.8.1, 60 32 bytes

χ3½⌠↓-ζ⁄∞Nη6′⁵‘Z{t",t5~r‘ooKo to

Explanation:

χ3½⌠↓-ζ⁄∞Nη6′⁵‘                   push "niooaaoasoioaiaaaoiineeaei"
               Z{                 for each letter of the uppercase alphabet
                 t                output the letter in a newline (and disable implicit output)
                  ",t5~r‘o        append " is for "
                          o       append the letter
                           Ko     append the 1st letter of the 1st string (the 2nd letters) and remove it
                              to  append "t"

This is pretty much Jonathan Allan's answer, but ported to this language.

Old version: (SOGL 0.8.2)

Z"sηΒ…@Ν┘$JP6*š∙╬F▓÷Σ⁷4⌠    ⁹{Tīο⁾α⅝½Χ<▼½Ξμ‚‘θ’»∫wGKO",t5~r‘P≥o


Z                                                             push the uppercase alphabet
 "sηΒ…@Ν┘$JP6*š∙╬F▓÷Σ⁷4⌠    ⁹{Tīο⁾α⅝½Χ<▼½Ξμ‚‘                  push the 27 words separated by spaces using the languages english compression (BCD...XYZA)
                                          θ                   split on spaces
                                           ’»∫                repeat 27 times (push 0-based pointer)
                                              w               get the 1-indexed item of the array (so 0 = last, 1 = first, 2 = 2nd,...)
                                               G              put the 1st thing on stack ontop (the alphabet)
                                                K             get the 1st letter and remove it
                                                 O            output it
                                                  ",t5~r‘     push compressed " is for "
                                                         P    append that (and disable last auto-output)
                                                          ≥   put the 1st thing on the stack below everything
                                                           o  append the last thing (the word from the word list)

output:

A is for against
B is for being
C is for could
D is for down
E is for even
F is for first
G is for good
H is for had
I is for into
J is for just
K is for know
L is for little
M is for much
N is for nothing
O is for other
P is for project
Q is for quite
R is for right
S is for said
T is for their
U is for under
V is for very
W is for with
X is for xavier
Y is for you
Z is for zoo

This is not the shortest this language can do, but should be the best with the words hard coded.

dzaima

Posted 2017-02-08T15:23:36.770

Reputation: 19 048

57

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 

zeppelin

Posted 2017-02-08T15:23:36.770

Reputation: 7 884

Does the name thing apply to any names (i.e. Cities, Continents e.t.c.) or only human names ? – zeppelin – 2017-02-08T15:46:58.350

Yeah. An alphabet song is typically for kids, and they don't use proper nouns. – mbomb007 – 2017-02-08T15:48:06.240

3Are lsof and xregs words? :) – OldBunny2800 – 2017-02-08T16:41:09.683

1@OldBunny2800 should be fixed now – zeppelin – 2017-02-08T17:12:03.210

2I looked it up, and yes, xyst is a real word. :) – OldBunny2800 – 2017-02-08T17:17:58.943

3Looks like kids are gonna be learning some big words. :D – mbomb007 – 2017-02-08T17:25:31.660

"What is a man?!" – mbomb007 – 2017-02-08T17:37:51.807

Have you an online interpreter link? I don't know bash or sed - is the word "xyst" going through the grep somewhere, or would using a 3 letter non-existent page work to save a byte? (Xis and Xat are options). – Jonathan Allan – 2017-02-09T10:49:10.713

1

@JonathanAllan Unfortunately, man page for "x" is not available on TIO, but here is a link https://tio.run/nexus/bash#@5@bmKdQUVlcEqOgAGTWqKUXpRYo6AbkK6jHJEUn6lbFVpvo1Cqo1xSnpiioF@vHaOjFaOrHlMYYKmQWK6TlFymo6QMl84tKFHRLsw11DP//BwA, 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 – 2017-02-09T11:50:07.590

I've considered using a 3-letter "x"-word instead, but that won't work, as the regexp looks for the 4-letter words (as otherwise the rest of the dictionary would not be correct). – zeppelin – 2017-02-09T11:51:22.620

Yeah, I saw the "4" in the grep and realised there must be invalid strings in there you needed to ignore. Thanks for the link! – Jonathan Allan – 2017-02-09T12:23:08.803

The challenge says "at least 3 letters" though... – RK. – 2017-02-13T01:10:39.227

33

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

Jonathan Allan

Posted 2017-02-08T15:23:36.770

Reputation: 67 804

4

I like the method of words that end in t. The iteration can be shortened by updating x in parallel.

– xnor – 2017-02-08T19:59:27.320

Very smart, as ever; thanks! – Jonathan Allan – 2017-02-08T20:09:20.857

1What's Unt? Can't find that one anywhere – Albert Renshaw – 2017-02-09T05:18:12.290

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 – 2017-02-09T05:20:40.817

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 – 2017-02-09T05:34:03.180

@JonathanAllan Oh I gotcha, it didn't return any results for me because I don't have access to M-W's unabridged section of their site. – Albert Renshaw – 2017-02-09T06:40:02.297

31

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.

zeppelin

Posted 2017-02-08T15:23:36.770

Reputation: 7 884

14

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

AdmBorkBork

Posted 2017-02-08T15:23:36.770

Reputation: 41 581

you can remove the first letter of each word (the capital one) and print with [char]$ example

– Rod – 2017-02-08T16:08:13.723

@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 – 2017-02-08T16:16:47.657

13

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 (6:l), 0:e (note the "e" on the right is at index zero [also 7 and -7 and any other number congruent to 0 mod 7]). 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)

Jonathan Allan

Posted 2017-02-08T15:23:36.770

Reputation: 67 804

Xenon is not an animal. I was sure you were making a joke by having H is for Herring, but I guess not. – mbomb007 – 2017-02-08T17:34:34.680

Heh, it was a lie. Xenon was the obvious one :) – Jonathan Allan – 2017-02-08T17:45:14.090

I think they are thinking of xenop, which is not in Jelly's dictionary.

– Jonathan Allan – 2017-02-08T17:54:23.767

Wonderful idea! But Uut? – Greg Martin – 2017-02-08T18:04:57.520

@GregMartin I agree, I think you started devolving your words into syllabic grunts. – Magic Octopus Urn – 2017-02-08T18:14:53.207

@GregMartin Oh, too quick with Google - I saw "Atomic Number 113" but failed to spot it is the symbol not the name... luckily an unt is a European Mole

– Jonathan Allan – 2017-02-08T18:21:49.687

What's a Xat? – AdmBorkBork – 2017-02-08T19:15:26.533

@AdmBorkBork Apparently it's a type of carved totem pole

– ETHproductions – 2017-02-08T19:24:45.993

I couldn't wait for an explanation so I picked apart the code myself with TIO. That's a genius idea, but I don't think it'll work in many other languages. We'll see... – ETHproductions – 2017-02-08T21:02:37.183

You can probably improve the 56-byte version to less than 52 via using base conversion and a lookup table to encode the string of letters. – None – 2017-02-08T22:33:14.303

@ais523 yes I think I can do 51, working on shortening – Jonathan Allan – 2017-02-08T22:47:08.220

@ais523 actually, nope I can't do 51 due to the chain having multiple nilads. I've done 53.

– Jonathan Allan – 2017-02-08T22:52:16.830

@ais523 ...but I've got the newer version down to 50 :D – Jonathan Allan – 2017-02-08T23:29:50.477

Aha, a jabot is "an ornamental frill or ruffle on the front of a shirt or blouse, typically made of lace". Obviously not an animal :-) – ETHproductions – 2017-02-09T00:44:21.407

@ETHproductions congratulations! – Jonathan Allan – 2017-02-09T00:45:48.740

@ais523 - turns out you were spot on - that version is now standing at 44 bytes using a base 8 (even though 7 letters) compression and indexing into the Cartesian product of the compressed string of the words "noise" plus "aura" and the letter "t". – Jonathan Allan – 2017-02-09T10:26:18.173

@boboquack thanks, looks like I wasn't quite on the ball. fixed. – Jonathan Allan – 2017-03-09T08:20:48.357

10

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.

Business Cat

Posted 2017-02-08T15:23:36.770

Reputation: 8 927

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 – 2017-02-08T18:03:13.933

@MartinEnder Thanks. What does $& do exactly? I didn't see it on the GitHub wiki. – Business Cat – 2017-02-08T18:15:16.960

It's an alias for $0 (and it's just part of the .NET flavour, as well as most other flavours). – Martin Ender – 2017-02-08T18:21:56.383

Using some shorter words to get it down to 83, try it online

– Jonathan Allan – 2017-02-09T01:59:15.803

8

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.

Martin Ender

Posted 2017-02-08T15:23:36.770

Reputation: 184 808

8

PHP, 122 124 127 120 115 101 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",ceaoaaei0eieeouoaaei0eeaei[$k]?:[I=>ka,U=>ni][$c],"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.

Ismael Miguel

Posted 2017-02-08T15:23:36.770

Reputation: 6 797

Clever solution I was going to do something similar, glad to see this! +1 – Albert Renshaw – 2017-02-08T23:27:59.640

1These aren't english words.... – Conor O'Brien – 2017-02-08T23:28:41.610

@ConorO'Brien Are you sure? PHP is all written in English, as far as I know. – Ismael Miguel – 2017-02-08T23:31:30.327

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 – 2017-02-08T23:32:19.727

I think those are in english... – Ismael Miguel – 2017-02-09T08:55:12.110

@ConorO'Brien Since you didn't like my list of English words in English, I made a new list of English words with words that are definetivelly written in English! – Ismael Miguel – 2017-02-09T13:05:08.550

@IsmaelMiguel It's not that I didn't like it, it's just that it was breaking the rules stated by the OP. I removed my downvote.. – Conor O'Brien – 2017-02-09T13:08:41.083

The words are at least 3 letters – Matthew Roh – 2017-02-09T13:57:55.500

@MatthewRoh Sorry, fixing it – Ismael Miguel – 2017-02-09T15:19:21.837

@MatthewRoh Thanks for pointing that out. I've fixed it now. If you see anything needing a fix, tell me. – Ismael Miguel – 2017-02-09T18:28:04.803

1I wouldn't call zit a weird word, at least, I think everyone should already know what it means. – mbomb007 – 2017-02-10T14:24:45.670

I honestly didn't. But English isnt my first language. I can remove the definition if you think it doesn't belong there. – Ismael Miguel – 2017-02-10T14:49:53.430

6

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.

Oliver

Posted 2017-02-08T15:23:36.770

Reputation: 7 160

6

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

Blue

Posted 2017-02-08T15:23:36.770

Reputation: 26 661

No. Also, I get an error running your code. – mbomb007 – 2017-02-08T19:41:03.257

Timeout running code. BAD EVAL Make sure you update your "Try it online" link. – mbomb007 – 2017-02-08T19:45:12.923

2Z is for zoofilia I would seriously consider before letting my kids sing this. – zeppelin – 2017-02-08T20:28:14.743

@zeppelin http://chat.stackexchange.com/transcript/message/35306609#35306609

– Blue – 2017-02-08T20:32:10.567

For anyone doing a double-take like I did: english is not always capitalized. ;)

– DLosc – 2017-02-08T22:58:05.243

6

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.

G B

Posted 2017-02-08T15:23:36.770

Reputation: 11 099

1Qat and Xis (plural of Xi) are words, so you can use them and also reduce your lookup regex to /#{l}../ – Value Ink – 2017-02-08T18:33:14.263

Thanks, I was thinking about something similar but I am away from my PC now, I will definitely check that. – G B – 2017-02-08T18:50:42.757

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 – 2017-02-08T20:12:59.947

1Kat is a valid word, so you can remove the special case for kit. – Business Cat – 2017-02-09T14:36:13.030

Very nice. Using some of your words could save me 3 bytes, but I can't find valid definitions for all of them. Words like dat and zat. Where did you find them? – Emigna – 2017-02-09T15:10:32.657

Originally from wordhippo, double-checked with other sources. Zat is a village in Iran (Wikipedia), Dat is a common abbreviation for "digital audio tape" (Thefreedictionary). "aat" and "uat" seem to be impossible. – G B – 2017-02-09T15:27:30.117

1I 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 – 2017-02-09T15:53:46.763

Iat is indeed controversial, I am using "imp" instead. I will check the rest. – G B – 2017-02-09T16:11:55.463

Would using ikat instead of imp help? – Ismael Miguel – 2017-02-09T18:30:14.053

I don't know, I have to find a pattern, or go back to the first idea. – G B – 2017-02-09T20:49:51.760

6

///, 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...

steenbergh

Posted 2017-02-08T15:23:36.770

Reputation: 7 772

2In the UK a yob is a lout, a thug, or a boor; more uncouth and rowdy than cruel and brutal. – Jonathan Allan – 2017-02-08T18:55:14.483

1In 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 – 2017-02-09T07:36:52.340

6

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']

Emigna

Posted 2017-02-08T15:23:36.770

Reputation: 50 798

5

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

cliffroot

Posted 2017-02-08T15:23:36.770

Reputation: 1 080

or, not orb, for 1 byte. – wizzwizz4 – 2017-02-08T20:58:28.793

1The minimum length is 3 letters – 12Me21 – 2017-02-08T22:12:44.483

@mbomb007 updated. – cliffroot – 2017-02-09T11:20:19.030

5

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

Adnan

Posted 2017-02-08T15:23:36.770

Reputation: 41 965

Can you explain why that pushes that array? – Magic Octopus Urn – 2017-02-08T17:13:08.680

I think 05AB1E has some built in words that can be represented by 2 bytes in a string. – 12Me21 – 2017-02-08T18:16:33.120

@12Me21 that's cool! ”–³”=Apple and int(–³,214)=23891 but I still don't see the correlation here. – Magic Octopus Urn – 2017-02-08T18:35:19.960

I believe this is the list: https://github.com/Adriandmen/05AB1E/blob/master/dictionary.py

– 12Me21 – 2017-02-08T18:37:32.363

2

@carusocomputing Here is a more detailed description of how the compression and decompression works.

– Adnan – 2017-02-08T18:38:39.537

@Adnan ahh... Odd way to index, but it works! – Magic Octopus Urn – 2017-02-08T18:40:11.000

January, Xanax, and Zoloft are proper names, aren't they? – DLosc – 2017-02-08T22:54:29.300

4

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

ETHproductions

Posted 2017-02-08T15:23:36.770

Reputation: 47 880

According to Wiktionary, you could use uzi and tiz...

– DLosc – 2017-02-08T23:06:10.993

@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 – 2017-02-08T23:46:39.390

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 – 2017-02-09T07:50:59.033

@DLosc I was already using piu, so that's not a problem at all :P Thanks! – ETHproductions – 2017-02-09T18:06:31.957

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 – 2017-02-09T20:59:28.113

3

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

Greg Martin

Posted 2017-02-08T15:23:36.770

Reputation: 13 940

eep, totally forgot, thanks – Greg Martin – 2017-02-08T20:29:00.613

3

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, recursion, 74 bytes

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

prints out the text from the first answer and then throws a PatternFormatException. We call the closure recursively starting with 'A' and incrementing ++char until the character after Z throws the error.

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, by recursing on main(...), 83 bytes

Assuming we count newlines as one character.

i=args?args[0]:'A'
println"$i is for ${'AntIvyUse'.find(/$i../)?:i+'at'}"
main(++i)

prints out the text from the first answer and then throws a PatternSyntaxException.

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"}

Matias Bjarland

Posted 2017-02-08T15:23:36.770

Reputation: 420

Kat is a valid word, so you can remove the special case for kit. – Business Cat – 2017-02-09T14:34:24.670

edited, thank you. Saved me 3 bytes : ) – Matias Bjarland – 2017-02-09T14:38:19.107

2

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

12Me21

Posted 2017-02-08T15:23:36.770

Reputation: 6 110

Example output? – snail_ – 2017-02-09T16:59:54.360

It's the same as this one: http://codegolf.stackexchange.com/questions/109502/create-an-alphabet-song/109530#109530

– 12Me21 – 2017-02-09T17:04:41.023

2

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.

Magic Octopus Urn

Posted 2017-02-08T15:23:36.770

Reputation: 19 422

qui is not an English word. Looking this up reveals only a Latin word. – mbomb007 – 2017-02-08T19:49:21.067

@mbomb007 was supposed to be Que I knew there was a 3 letter legal scrabble word, misspelled it. – Magic Octopus Urn – 2017-02-08T19:59:49.380

Nice words :) could be replaced with ,. – Emigna – 2017-02-09T07:35:23.610

2

Lithp, 136 125 117 bytes

((import lists)(each(split "niooaauusoioaiuaaoiineeaei" "")
#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
  • Saved 8 bytes by removing useless call to (scope #)

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

Andrakis

Posted 2017-02-08T15:23:36.770

Reputation: 361

2Great name! (I don't, thuffer from a lithp, doethe the language have thuch a thpeech ithue though?) – Jonathan Allan – 2017-02-09T14:14:44.107

1Thank 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 – 2017-02-09T14:16:45.403

1

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

Neil

Posted 2017-02-08T15:23:36.770

Reputation: 95 035

1

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

Conor O'Brien

Posted 2017-02-08T15:23:36.770

Reputation: 36 228

1

Java 7, 124 121 bytes

String c(){String r="";for(char c=65;c<91;r+=c+" is for "+c+"baaonaiineioaeaoaaeileeaoi".charAt(c++-65)+"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 c=65;c<91;r+=c+" is for "+c+"baaonaiineioaeaoaaeileeaoi".charAt(c++-65)+"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

Kevin Cruijssen

Posted 2017-02-08T15:23:36.770

Reputation: 67 575

1+1 for +a+++. I like writing those :P – Poke – 2017-02-10T16:09:50.537

1

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

PidgeyUsedGust

Posted 2017-02-08T15:23:36.770

Reputation: 631

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 – 2017-02-09T14:29:57.497

1Just noticed that my regex doesn't match until the end of each word -- will fix. – PidgeyUsedGust – 2017-02-09T14:37:40.903

Fixed it. Now only looking for lowercase, complete words to not have names in there. – PidgeyUsedGust – 2017-02-09T15:25:20.897

1

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

Kelly Lowder

Posted 2017-02-08T15:23:36.770

Reputation: 3 225

1

Groovy, 72 bytes

c=65;"niooaauusoioaiuaaoiineeaei".any{printf"%c is for %<c%st\n",c++,it}

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

Peter De Bruycker

Posted 2017-02-08T15:23:36.770

Reputation: 11

1

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

seshoumara

Posted 2017-02-08T15:23:36.770

Reputation: 2 878

1

PHP, 91 87 86 76 bytes

based on Jonathan Allan´s word list:

for($a=A;$i<26;)echo"$a is for ",$a++,neaoaaeiseioeuuoaaiineiaei[$i++],"t
";

older versions, 86 bytes:

for($a=A;a&$c=reaoaaei0eioeuuoaaii0eiaei[$i++];)echo"$a is for ",$a++,$c?$c.t:nto,"
";

or

for($a=A;$c=reaoaaeiHeioeuuoaaiiHeiaei[$i++];)echo"$a is for ",$a++,$c^x?$c.t:nto,"
";

Run with -nr.

output

A is for Art
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 Into
J is for Jet
K is for Kit
L is for Lot
M is for Met
N is for Nut
O is for Out
P is for Pot
Q is for Qat
R is for Rat
S is for Sit
T is for Tit
U is for Unto
V is for Vet
W is for Wit
X is for Xat
Y is for Yet
Z is for Zit

For the weird words, see Ismael´s answer

Titus

Posted 2017-02-08T15:23:36.770

Reputation: 13 814

0

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.

ElPedro

Posted 2017-02-08T15:23:36.770

Reputation: 5 301

0

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)])

hashcode55

Posted 2017-02-08T15:23:36.770

Reputation: 581

@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 - http://dictionary.cambridge.org/dictionary/english/rambo

– hashcode55 – 2017-02-08T22:57:16.780

0

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!

James Holderness

Posted 2017-02-08T15:23:36.770

Reputation: 8 298

0

Perl 5, 72 bytes

say"$_ is for $_",(niooaaoasoioaiaaaoiineeaei=~/./g)[-65+ord],t for A..Z

Try it online!

Xcali

Posted 2017-02-08T15:23:36.770

Reputation: 7 671

0

Jelly, 153 bytes (hardcoded words)

“¢r£ẒẸv⁽Ẋ⁷ƥḷṢ⁴kṣe]Ȧ½ṇZṅẸȥɓ!ṗẒ/¿`-¤ḅṘẠṗıBṖ²}çSṘ¦qḤAi\Ḃɲ=T¿?İ®ʋÇIZ(ṅ/ß+oŻ#⁽ƙ©Ḷ!&ẋṡU7FocĊ¶€¢¦ḥLØṀ¿;ȥż!Ọerṫ÷1Ẹjẏ8Ƙ&£ṃṾḊ¿Ṅ⁾ị°ÑBḅQ²€œðḤDẊj£ṅĠsṿBsƤȤ»ṣ”%j“ẉbẊWS»

Try it online!

A is for Apple
B is for Bald
C is for Cabin
D is for Dairy
E is for Eagle
F is for Fact
G is for Gauge
H is for Humid
I is for Iamb
J is for Jar
K is for Keg
L is for Lad
M is for Music
N is for Nose
O is for Oak
P is for Page
Q is for Quart
R is for Rag
S is for Sock
T is for Taco
U is for Udon
V is for Vault
W is for Week
X is for Xylophone
Y is for Yard
Z is for Zoo

ellie

Posted 2017-02-08T15:23:36.770

Reputation: 131