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 = {
99
99
}
100
100
} ) ( ) ,
101
101
}
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.
84
84
85
85
### Feedback
86
86
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
88
88
solvers. The rules try to make a sensible set of choices for the comparison. We welcome any comments
89
89
or suggestions regarding the running of this challenge.
90
90
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ on any questions that arise during the competition.
86
86
87
87
### Feedback
88
88
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
90
90
solvers. The rules try to make a sensible set of choices for the comparison. We welcome any comments
91
91
or suggestions regarding the running of this challenge.
92
92
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'
2
2
import { Container } from ' @/components/Container'
3
3
import { Footer } from ' @/components/Footer'
4
4
import { Link } from ' @/components/Link'
@@ -86,7 +86,7 @@ on any questions that arise during the competition.
86
86
87
87
### Feedback
88
88
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
90
90
solvers. The rules try to make a sensible set of choices for the comparison. We welcome any comments
91
91
or suggestions regarding the running of this challenge.
92
92
You can’t perform that action at this time.
0 commit comments