Skip to main content
Commonmark migration
Source Link

R (with english package), 16 bytes / 16 bytes

### Part 1, 16 bytes

Part 1, 16 bytes

f=function(n)1:n

Part 2, 16 bytes

english::ordinal

Requires the english package (which is not installed on TIO, unfortunately).

english::ordinal(f(22)) outputs first second third fourth fifth sixth seventh eighth ninth tenth eleventh twelfth thirteenth fourteenth fifteenth sixteenth seventeenth eighteenth nineteenth twentieth twenty first twenty second.

Of course, part 1 could be made much shorter (3 bytes: seq), but that would go against the constraint that part 2 has to be no longer than part 1.

R (with english package), 16 bytes / 16 bytes

### Part 1, 16 bytes

f=function(n)1:n

Part 2, 16 bytes

english::ordinal

Requires the english package (which is not installed on TIO, unfortunately).

english::ordinal(f(22)) outputs first second third fourth fifth sixth seventh eighth ninth tenth eleventh twelfth thirteenth fourteenth fifteenth sixteenth seventeenth eighteenth nineteenth twentieth twenty first twenty second.

Of course, part 1 could be made much shorter (3 bytes: seq), but that would go against the constraint that part 2 has to be no longer than part 1.

R (with english package), 16 bytes / 16 bytes

Part 1, 16 bytes

f=function(n)1:n

Part 2, 16 bytes

english::ordinal

Requires the english package (which is not installed on TIO, unfortunately).

english::ordinal(f(22)) outputs first second third fourth fifth sixth seventh eighth ninth tenth eleventh twelfth thirteenth fourteenth fifteenth sixteenth seventeenth eighteenth nineteenth twentieth twenty first twenty second.

Of course, part 1 could be made much shorter (3 bytes: seq), but that would go against the constraint that part 2 has to be no longer than part 1.

added 25 characters in body
Source Link
Robin Ryder
  • 15.6k
  • 2
  • 24
  • 70

R (with english package), 16 bytes / 16 bytes

### Part 1, 16 bytes

f=function(n)1:n

Part 2, 16 bytes

english::ordinal

Requires the english package (which is not installed on TIO, unfortunately).

english::ordinal(f(22)) outputs first second third fourth fifth sixth seventh eighth ninth tenth eleventh twelfth thirteenth fourteenth fifteenth sixteenth seventeenth eighteenth nineteenth twentieth twenty first twenty second.

Of course, part 1 could be made much shorter (3 bytes: seq), but that would go against the constraint that part 2 has to be no longer than part 1.

R, 16 bytes / 16 bytes

### Part 1, 16 bytes

f=function(n)1:n

Part 2, 16 bytes

english::ordinal

Requires the english package (which is not installed on TIO, unfortunately).

english::ordinal(f(22)) outputs first second third fourth fifth sixth seventh eighth ninth tenth eleventh twelfth thirteenth fourteenth fifteenth sixteenth seventeenth eighteenth nineteenth twentieth twenty first twenty second.

Of course, part 1 could be made much shorter (3 bytes: seq), but that would go against the constraint that part 2 has to be no longer than part 1.

R (with english package), 16 bytes / 16 bytes

### Part 1, 16 bytes

f=function(n)1:n

Part 2, 16 bytes

english::ordinal

Requires the english package (which is not installed on TIO, unfortunately).

english::ordinal(f(22)) outputs first second third fourth fifth sixth seventh eighth ninth tenth eleventh twelfth thirteenth fourteenth fifteenth sixteenth seventeenth eighteenth nineteenth twentieth twenty first twenty second.

Of course, part 1 could be made much shorter (3 bytes: seq), but that would go against the constraint that part 2 has to be no longer than part 1.

Source Link
Robin Ryder
  • 15.6k
  • 2
  • 24
  • 70

R, 16 bytes / 16 bytes

### Part 1, 16 bytes

f=function(n)1:n

Part 2, 16 bytes

english::ordinal

Requires the english package (which is not installed on TIO, unfortunately).

english::ordinal(f(22)) outputs first second third fourth fifth sixth seventh eighth ninth tenth eleventh twelfth thirteenth fourteenth fifteenth sixteenth seventeenth eighteenth nineteenth twentieth twenty first twenty second.

Of course, part 1 could be made much shorter (3 bytes: seq), but that would go against the constraint that part 2 has to be no longer than part 1.