RosettaCodeData/Task/Nth/Rye/nth.rye
2026-04-30 12:34:36 -04:00

8 lines
211 B
Text

nth: fn { n } {
++ either { 11 12 13 } .contains n % 100 { "th" } {
{ "th" "st" "nd" "rd" "th" } -> clamp n % 10 0 4
}
}
[ range 0 25 range 250 265 range 1000 1025 ]
.for { .map ?nth |print }