Skip to main content
deleted 21 characters in body
Source Link
pxeger
  • 24.6k
  • 4
  • 53
  • 141

ZshZsh -y, 412 383 bytes

for x y (first
two-turtle-doves second
three-french-hens third
`for a b (four call\ -birds
five golden-r\ s
six geese-a-lay
seven swans-a-swimm
eight maids-a-milk
nine ladies-danc
ten lords-a-leap
eleven pipers-pip
twelve drummers-drumm)()(<<<$a-$1ing$2\ ${${a%[et]}/%v/f}th) $b`)<<<"On the $x day of Christmas
my true love gave to me
$1a partridge in a pear tree
"&&1="$y
${1-and- }"

Attempt This Online!Attempt This Online!

This may be the first time I've used Zsh's anonymous functions in golf. By combining it with the -y option, I can conveniently split $b into $1 and $2.

Makes use of some interesting symmetries:

  • all the gifts (starting with the fourth) contain ing
  • five -> fifth; twelve -> twelfth (that's a mini-etymology lesson for you)
  • nine -> ninth; eight -> eighth

Zsh -y, 412 383 bytes

for x y (first
two-turtle-doves second
three-french-hens third
`for a b (four call\ -birds
five golden-r\ s
six geese-a-lay
seven swans-a-swimm
eight maids-a-milk
nine ladies-danc
ten lords-a-leap
eleven pipers-pip
twelve drummers-drumm)()(<<<$a-$1ing$2\ ${${a%[et]}/%v/f}th) $b`)<<<"On the $x day of Christmas
my true love gave to me
$1a partridge in a pear tree
"&&1="$y
${1-and-}"

Attempt This Online!

This may be the first time I've used Zsh's anonymous functions in golf. By combining it with the -y option, I can conveniently split $b into $1 and $2.

Makes use of some interesting symmetries:

  • all the gifts (starting with the fourth) contain ing
  • five -> fifth; twelve -> twelfth (that's a mini-etymology lesson for you)
  • nine -> ninth; eight -> eighth

Zsh -y, 383 bytes

for x y (first
two-turtle-doves second
three-french-hens third
`for a b (four call\ -birds
five golden-r\ s
six geese-a-lay
seven swans-a-swimm
eight maids-a-milk
nine ladies-danc
ten lords-a-leap
eleven pipers-pip
twelve drummers-drumm)()(<<<$a-$1ing$2\ ${${a%[et]}/%v/f}th) $b`)<<<"On the $x day of Christmas
my true love gave to me
$1a partridge in a pear tree
"&&1="$y
${1-and }"

Attempt This Online!

This may be the first time I've used Zsh's anonymous functions in golf. By combining it with the -y option, I can conveniently split $b into $1 and $2.

Makes use of some interesting symmetries:

  • all the gifts (starting with the fourth) contain ing
  • five -> fifth; twelve -> twelfth (that's a mini-etymology lesson for you)
  • nine -> ninth; eight -> eighth
added 398 characters in body
Source Link
pxeger
  • 24.6k
  • 4
  • 53
  • 141

Zsh -y, 412412 383 bytes

1=ing 0=and-
for 1x 2y (first  
two-turtle-doves
second second
three-french-hens
  third
`for a b (four-call$1 call\ -birds
forth five- golden-r$1s
fifthr\ s
six- geese-a-lay$1lay
sixth seven- swans-a-swimm$1swimm
seventh eight- maids-a-milk$1milk
eighth nine- ladies-danc$1danc
ninth ten- lords-a-leap$1leap
tenth eleven- pipers-pip$1pip
eleventh twelve- drummers-drumm$1
twelfthdrumm)()(<<<$a-$1ing$2\ ${${a%[et]}/%v/f}th) $b`)<<<"On the $1$x day of Christmas
my true love gave to me
$0a$1a partridge in a pear tree
"&&0="$2"&&1="$y
$0"${1-and-}"

Attempt This Online!Attempt This Online!

This may be the first time I've used Zsh's anonymous functions in golf. By combining it with the -y option, I can conveniently split $b into $1 and $2.

Makes use of some interesting symmetries:

  • all the gifts (starting with the fourth) contain ing
  • five -> fifth; twelve -> twelfth (that's a mini-etymology lesson for you)
  • nine -> ninth; eight -> eighth

Zsh, 412 bytes

1=ing 0=and-
for 1 2 (first two-turtle-doves
second three-french-hens
 third four-call$1-birds
forth five-golden-r$1s
fifth six-geese-a-lay$1
sixth seven-swans-a-swimm$1
seventh eight-maids-a-milk$1
eighth nine-ladies-danc$1
ninth ten-lords-a-leap$1
tenth eleven-pipers-pip$1
eleventh twelve-drummers-drumm$1
twelfth)<<<"On the $1 day of Christmas
my true love gave to me
$0a partridge in a pear tree
"&&0="$2
$0"

Attempt This Online!

Zsh -y, 412 383 bytes

for x y (first 
two-turtle-doves second
three-french-hens third
`for a b (four call\ -birds
five golden-r\ s
six geese-a-lay
seven swans-a-swimm
eight maids-a-milk
nine ladies-danc
ten lords-a-leap
eleven pipers-pip
twelve drummers-drumm)()(<<<$a-$1ing$2\ ${${a%[et]}/%v/f}th) $b`)<<<"On the $x day of Christmas
my true love gave to me
$1a partridge in a pear tree
"&&1="$y
${1-and-}"

Attempt This Online!

This may be the first time I've used Zsh's anonymous functions in golf. By combining it with the -y option, I can conveniently split $b into $1 and $2.

Makes use of some interesting symmetries:

  • all the gifts (starting with the fourth) contain ing
  • five -> fifth; twelve -> twelfth (that's a mini-etymology lesson for you)
  • nine -> ninth; eight -> eighth
Source Link
pxeger
  • 24.6k
  • 4
  • 53
  • 141

Zsh, 412 bytes

1=ing 0=and-
for 1 2 (first two-turtle-doves
second three-french-hens
third four-call$1-birds
forth five-golden-r$1s
fifth six-geese-a-lay$1
sixth seven-swans-a-swimm$1
seventh eight-maids-a-milk$1
eighth nine-ladies-danc$1
ninth ten-lords-a-leap$1
tenth eleven-pipers-pip$1
eleventh twelve-drummers-drumm$1
twelfth)<<<"On the $1 day of Christmas
my true love gave to me
$0a partridge in a pear tree
"&&0="$2
$0"

Attempt This Online!