Skip to main content
added 4100 characters in body
Source Link
ovs
  • 60.6k
  • 3
  • 47
  • 161

Commented:

“¤†É¾£‡—Ä‹·î€“              # push dictionary compressed string "fly spider bird cat dog horse"
#                           # split on spaces
©                           # store the list of animals in the register
€“€Ç€¥€¤„Ï£î€Ð 1ed€… ÿ,“    # for each animal, push the string "there was an old lady who 1ed a ÿ,"
                            #   where ÿ s replaced by the animal
®                           # push the list of animals again
¦¦¨                         # remove the fly, the spider and the horse: ["bird", "cat", "dog"]
.•Ω\3¯ÓõÔ)V₄H`«Å₆éÅΘΓåò•    # push alphabet compressed string "xhow absurdximagine thatxwhat a hog"
ć                           # extract the first character "x"
¡                           # split the remaining string on "x": ["how absurd", "imagine that", "what a hog"]
δ"ÿ to 1 a ÿ."Å\            # format the string "ÿ to 1 a ÿ." with a value from this list and one from the short animal list
                            #  => ["how absurd to 1 a bird.", "imagine that to 1 a cat.", "what a hog to 1 a dog."]
“€Š wr0€ƒ 0€ƒ j0‹â‚®.“      # push compressed dictionary string "that wr0 and 0 and j0 inside her."
š                           # prepend this to the list
“‚Îœ·€‚…£.“                 # push compressed dictionary string "she died of course."
ª                           # append this to the list
0š                          # prepeand a 0
ø                           # zip both lists together
0δK                         # remove 0's in sublists
                            #  => [["there was an old lady who 1ed a fly,"],
                            #      ["there was an old lady who 1ed a spider,", "that wr0 and 0 and j0 inside her."],
                            #      ["there was an old lady who 1ed a bird,", "how absurd to 1 a bird."],
                            #      ["there was an old lady who 1ed a cat,", "imagine that to 1 a cat."],
                            #      ["there was an old lady who 1ed a dog,", "what a hog to 1 a dog."],
                            #      ["there was an old lady who 1ed a horse,", "she died of course."]]
®                           # push the list of animals again
ü“‚Î 1ed€€ ÿ€„¬ª€€ ÿ,“      # format the string "she 1ed the ÿ to catch the ÿ," with adjacent pairs of animals
¨                           # remove the last string
                            #  => ["she 1ed the spider to catch the fly,", "she 1ed the bird to catch the spider,", "she 1ed the cat to catch the bird,", "she 1ed the dog to catch the cat,"]
η                           # take the prefixes of this list
í                           # reverse each prefix
õš                          # prepend the empty string
ε                           # map over the prefixes:
  “i¥Ú'tƒ€„Ý‚Î 1ed€Š¤†,“    #   push compressed string "i don't know why she 1ed that fly,"
  ª                         #   append to the prefix
  “™¡‚Î'll—Ç.\n“            #   push compressed string "perhaps she'll die.\n"
  ª                         #   append to the prefix
}                           # end of map
õª                          # append an empty string to the list of prefixes
.ι                          # interleave the list of prefixes with the earlier list
˜                           # flatten everything into a list of lines
.ª                          # sentence-case each line
»                           # join by newlines
T                           # push 10
.•4Ƶ›₅8zεÚS•                # push compressed string "swallow iggled"
#                           # split on the space
‡                           # in the poem replace every digit of 10 with the corresponding word in this list
                            #   1 -> swallow, 0 -> iggled
¨                           # remove a trailing newline
','..;                      # replace the first "," with a "."

Commented:

“¤†É¾£‡—Ä‹·î€“              # push dictionary compressed string "fly spider bird cat dog horse"
#                           # split on spaces
©                           # store the list of animals in the register
€“€Ç€¥€¤„Ï£î€Ð 1ed€… ÿ,“    # for each animal, push the string "there was an old lady who 1ed a ÿ,"
                            #   where ÿ s replaced by the animal
®                           # push the list of animals again
¦¦¨                         # remove the fly, the spider and the horse: ["bird", "cat", "dog"]
.•Ω\3¯ÓõÔ)V₄H`«Å₆éÅΘΓåò•    # push alphabet compressed string "xhow absurdximagine thatxwhat a hog"
ć                           # extract the first character "x"
¡                           # split the remaining string on "x": ["how absurd", "imagine that", "what a hog"]
δ"ÿ to 1 a ÿ."Å\            # format the string "ÿ to 1 a ÿ." with a value from this list and one from the short animal list
                            #  => ["how absurd to 1 a bird.", "imagine that to 1 a cat.", "what a hog to 1 a dog."]
“€Š wr0€ƒ 0€ƒ j0‹â‚®.“      # push compressed dictionary string "that wr0 and 0 and j0 inside her."
š                           # prepend this to the list
“‚Îœ·€‚…£.“                 # push compressed dictionary string "she died of course."
ª                           # append this to the list
0š                          # prepeand a 0
ø                           # zip both lists together
0δK                         # remove 0's in sublists
                            #  => [["there was an old lady who 1ed a fly,"],
                            #      ["there was an old lady who 1ed a spider,", "that wr0 and 0 and j0 inside her."],
                            #      ["there was an old lady who 1ed a bird,", "how absurd to 1 a bird."],
                            #      ["there was an old lady who 1ed a cat,", "imagine that to 1 a cat."],
                            #      ["there was an old lady who 1ed a dog,", "what a hog to 1 a dog."],
                            #      ["there was an old lady who 1ed a horse,", "she died of course."]]
®                           # push the list of animals again
ü“‚Î 1ed€€ ÿ€„¬ª€€ ÿ,“      # format the string "she 1ed the ÿ to catch the ÿ," with adjacent pairs of animals
¨                           # remove the last string
                            #  => ["she 1ed the spider to catch the fly,", "she 1ed the bird to catch the spider,", "she 1ed the cat to catch the bird,", "she 1ed the dog to catch the cat,"]
η                           # take the prefixes of this list
í                           # reverse each prefix
õš                          # prepend the empty string
ε                           # map over the prefixes:
  “i¥Ú'tƒ€„Ý‚Î 1ed€Š¤†,“    #   push compressed string "i don't know why she 1ed that fly,"
  ª                         #   append to the prefix
  “™¡‚Î'll—Ç.\n“            #   push compressed string "perhaps she'll die.\n"
  ª                         #   append to the prefix
}                           # end of map
õª                          # append an empty string to the list of prefixes
.ι                          # interleave the list of prefixes with the earlier list
˜                           # flatten everything into a list of lines
.ª                          # sentence-case each line
»                           # join by newlines
T                           # push 10
.•4Ƶ›₅8zεÚS•                # push compressed string "swallow iggled"
#                           # split on the space
‡                           # in the poem replace every digit of 10 with the corresponding word in this list
                            #   1 -> swallow, 0 -> iggled
¨                           # remove a trailing newline
','..;                      # replace the first "," with a "."
added 100 characters in body
Source Link
ovs
  • 60.6k
  • 3
  • 47
  • 161

05AB1E, 237 222 218218 224 bytes

+6 bytes to fix a bug (In most verses the first line ends in a ,)

“¤†É¾£‡—Ä‹·î€“#©€“€Ç€¥€¤„Ï£î€Ð 1ed€… ÿ.,“®¦¦¨.•Ω\3¯ÓõÔ)V₄H`«Å₆éÅΘΓåò•ć¡δ"ÿ to 1 a ÿ."Å\“€Š wr0€ƒ 0€ƒ j0‹â‚®.“š“‚Îœ·€‚…£.“ª0šø0δK®ü“‚Î 1ed€€ ÿ€„¬ª€€ ÿ,“¨ηíõšε“i¥Ú'tƒ€„Ý‚Î 1ed€Š¤†,“ª“™¡‚Î'll—Ç.
“ª}õª.ι˜.ª»T.•4Ƶ›₅8zεÚS•#‡¨•4Ƶ›₅8zεÚS•#‡¨','..;

Try it online!Try it online!

05AB1E, 237 222 218 bytes

“¤†É¾£‡—Ä‹·î€“#©€“€Ç€¥€¤„Ï£î€Ð 1ed€… ÿ.“®¦¦¨.•Ω\3¯ÓõÔ)V₄H`«Å₆éÅΘΓåò•ć¡δ"ÿ to 1 a ÿ."Å\“€Š wr0€ƒ 0€ƒ j0‹â‚®.“š“‚Îœ·€‚…£.“ª0šø0δK®ü“‚Î 1ed€€ ÿ€„¬ª€€ ÿ,“¨ηíõšε“i¥Ú'tƒ€„Ý‚Î 1ed€Š¤†,“ª“™¡‚Î'll—Ç.
“ª}õª.ι˜.ª»T.•4Ƶ›₅8zεÚS•#‡¨

Try it online!

05AB1E, 237 222 218 224 bytes

+6 bytes to fix a bug (In most verses the first line ends in a ,)

“¤†É¾£‡—Ä‹·î€“#©€“€Ç€¥€¤„Ï£î€Ð 1ed€… ÿ,“®¦¦¨.•Ω\3¯ÓõÔ)V₄H`«Å₆éÅΘΓåò•ć¡δ"ÿ to 1 a ÿ."Å\“€Š wr0€ƒ 0€ƒ j0‹â‚®.“š“‚Îœ·€‚…£.“ª0šø0δK®ü“‚Î 1ed€€ ÿ€„¬ª€€ ÿ,“¨ηíõšε“i¥Ú'tƒ€„Ý‚Î 1ed€Š¤†,“ª“™¡‚Î'll—Ç.
“ª}õª.ι˜.ª»T.•4Ƶ›₅8zεÚS•#‡¨','..;

Try it online!

deleted 74 characters in body
Source Link
ovs
  • 60.6k
  • 3
  • 47
  • 161

05AB1E, 237 222222 218 bytes

There is probably some stuff to optimize, e.g. €ʒĀ}δšÅ\ feels very long.

“¤†É¾£‡—Ä‹·î€“#©ü“‚Î 1ed€€ ÿ€„¬ª€€ ÿ,“¨ηíõšε“i¥Ú'tƒ€„Ý‚Î 1ed€Š¤†,“ª“™¡‚Î'll—Ç.
“ª}õª®ε“€Ç€¥€¤„Ï£î€Ð“¤†É¾£‡—Ä‹·î€“#©€“€Ç€¥€¤„Ï£î€Ð 1ed€… ÿ.“}®¦¦¨“®¦¦¨.•Ω\3¯ÓõÔ)V₄H`«Å₆éÅΘΓåò•ć¡øε`"ÿV₄H`«Å₆éÅΘΓåò•ć¡δ"ÿ to 1 a ÿ."}“€Š"Å\“€Š wr0€ƒ 0€ƒ j0‹â‚®.“š“‚Îœ·€‚…£.“ªõšø€ʒĀ“ª0šø0δK®ü“‚Î 1ed€€ ÿ€„¬ª€€ ÿ,“¨ηíõšε“i¥Ú'tƒ€„Ý‚Î 1ed€Š¤†,“ª“™¡‚Î'll—Ç.
“ª}δšÅ\˜õª.ι˜.ª»T.•4Ƶ›₅8zεÚS•#‡•4Ƶ›₅8zεÚS•#‡¨

Try it online!Try it online!

05AB1E, 237 222 bytes

There is probably some stuff to optimize, e.g. €ʒĀ}δšÅ\ feels very long.

“¤†É¾£‡—Ä‹·î€“#©ü“‚Î 1ed€€ ÿ€„¬ª€€ ÿ,“¨ηíõšε“i¥Ú'tƒ€„Ý‚Î 1ed€Š¤†,“ª“™¡‚Î'll—Ç.
“ª}õª®ε“€Ç€¥€¤„Ï£î€Ð 1ed€… ÿ.“}®¦¦¨.•Ω\3¯ÓõÔ)V₄H`«Å₆éÅΘΓåò•ć¡øε`"ÿ to 1 a ÿ."}“€Š wr0€ƒ 0€ƒ j0‹â‚®.“š“‚Îœ·€‚…£.“ªõšø€ʒĀ}δšÅ\˜.ª»T.•4Ƶ›₅8zεÚS•#‡

Try it online!

05AB1E, 237 222 218 bytes

“¤†É¾£‡—Ä‹·î€“#©€“€Ç€¥€¤„Ï£î€Ð 1ed€… ÿ.“®¦¦¨.•Ω\3¯ÓõÔ)V₄H`«Å₆éÅΘΓåò•ć¡δ"ÿ to 1 a ÿ."Å\“€Š wr0€ƒ 0€ƒ j0‹â‚®.“š“‚Îœ·€‚…£.“ª0šø0δK®ü“‚Î 1ed€€ ÿ€„¬ª€€ ÿ,“¨ηíõšε“i¥Ú'tƒ€„Ý‚Î 1ed€Š¤†,“ª“™¡‚Î'll—Ç.
“ª}õª.ι˜.ª»T.•4Ƶ›₅8zεÚS•#‡¨

Try it online!

deleted 6 characters in body
Source Link
ovs
  • 60.6k
  • 3
  • 47
  • 161
Loading
deleted 2 characters in body
Source Link
ovs
  • 60.6k
  • 3
  • 47
  • 161
Loading
-6 bytes
Source Link
ovs
  • 60.6k
  • 3
  • 47
  • 161
Loading
Source Link
ovs
  • 60.6k
  • 3
  • 47
  • 161
Loading