Skip to content

Conversation

@BNAndras
Copy link
Member

No description provided.

@BNAndras BNAndras added x:module/practice-exercise Work on Practice Exercises x:rep/large Large amount of reputation labels Oct 14, 2025
@BNAndras BNAndras requested a review from kotp October 14, 2025 05:17
elseif l:mod10 == 3 && l:mod100 != 13
return 'rd'
endif
return 'th'
Copy link
Member

@kotp kotp Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider continuing the if statement with an else as the default. The return 'th' is otherwise an implicit else and makes it seem like it is not related to the if statement.

This is an example solution, though, so does not need to be exemplar.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 17 is the happy path for most numbers so it's aligned to the left while the if....elseifs are the special cases. Considering each branch returns, I could do away with the elseif and do if for the three special cases, but I didn't want to bother adding the additional endif lines.

@kotp kotp merged commit 5a22602 into exercism:main Oct 14, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

x:module/practice-exercise Work on Practice Exercises x:rep/large Large amount of reputation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants