File tree Expand file tree Collapse file tree 4 files changed +25
-4
lines changed
Expand file tree Collapse file tree 4 files changed +25
-4
lines changed Original file line number Diff line number Diff line change @@ -99,3 +99,24 @@ export const info = {
9999 }
100100 } ) ( ) ,
101101}
102+
103+ /// Get ordinal representation of challenge year
104+ export function nthYear ( year ) {
105+ const n = year - 2008 + 1
106+ const s = n % 100 ;
107+ if ( s > 3 && s < 21 ) {
108+ return < > { n } < sup > th</ sup > </ > ;
109+ }
110+ switch ( s % 10 ) {
111+ case 1 : {
112+ return < > { n } < sup > st</ sup > </ > ;
113+ }
114+ case 2 : {
115+ return < > { n } < sup > nd</ sup > </ > ;
116+ }
117+ case 3 : {
118+ return < > { n } < sup > rd</ sup > </ > ;
119+ }
120+ }
121+ return < > { n } < sup > th</ sup > </ > ;
122+ }
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ on any questions that arise during the competition.
8484
8585### Feedback
8686
87- This is the 15th time this challenge is being run, and there are many possibilities for comparing CP
87+ This is the 16th time this challenge is being run, and there are many possibilities for comparing CP
8888solvers. The rules try to make a sensible set of choices for the comparison. We welcome any comments
8989or suggestions regarding the running of this challenge.
9090
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ on any questions that arise during the competition.
8686
8787### Feedback
8888
89- This is the 15th time this challenge is being run, and there are many possibilities for comparing CP
89+ This is the 17th time this challenge is being run, and there are many possibilities for comparing CP
9090solvers. The rules try to make a sensible set of choices for the comparison. We welcome any comments
9191or suggestions regarding the running of this challenge.
9292
Original file line number Diff line number Diff line change 1- import { info } from ' @/data/challenge/info'
1+ import { info , nthYear } from ' @/data/challenge/info'
22import { Container } from ' @/components/Container'
33import { Footer } from ' @/components/Footer'
44import { Link } from ' @/components/Link'
@@ -86,7 +86,7 @@ on any questions that arise during the competition.
8686
8787### Feedback
8888
89- This is the 15th time this challenge is being run, and there are many possibilities for comparing CP
89+ This is the { nthYear ( year ) } time this challenge is being run, and there are many possibilities for comparing CP
9090solvers. The rules try to make a sensible set of choices for the comparison. We welcome any comments
9191or suggestions regarding the running of this challenge.
9292
You can’t perform that action at this time.
0 commit comments