Clarify rule exclusions for `line-up`

This came up in a Racket PR review, but the Line Up rules are unclear about what gets excluded.

Rules:

  • Numbers ending in 1 (except for 11) → "st"
  • Numbers ending in 2 (except for 12) → "nd"
  • Numbers ending in 3 (except for 13) → "rd"
  • All other numbers → "th"

The text in the parentheses can be read as describing the numbers themselves and not the digits. That means 11 is excluded but not 111 so we get 11th but 111st.

The proposed change

Rules:

  • Numbers ending in 1 (except those ending in 11) → "st"
  • Numbers ending in 2 (except those ending in 12) → "nd"
  • Numbers ending in 3 (except those ending in 13) → "rd"
  • All other numbers → "th"
3 Likes

Yes, @keiraville comented the same thing in the PR, but the exercise was already merged at the time.

1 Like

Alright, let’s see what other maintainers think about updating the text. :slight_smile:

Seems reasonable to me

Totally reasonable. Can’t believe that I missed that in the original discussion.

+1 for a clarification.

@keiraville suggested in the PR as mentioned above:

Perhaps this should have been (unless ending in 13) to allow for numbers like 913.

This looks a bit shorter than the proposed (except those ending in 11). But I have no preferences here, pick whatever is clear enough.

1 Like

See Clarify `line-up` rules by BNAndras · Pull Request #2602 · exercism/problem-specifications · GitHub. I went for keiraville’s original wording.

1 Like

Merged. Thanks to you all!

1 Like