Data update
This commit is contained in:
parent
0df55f9f24
commit
aec8ed51b6
1045 changed files with 18889 additions and 2777 deletions
14
Task/Nth/Fennel/nth.fennel
Normal file
14
Task/Nth/Fennel/nth.fennel
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
(fn get-suffix [n]
|
||||
(let [last-two (% n 100)
|
||||
last-one (% n 10)]
|
||||
(if (and (> last-two 3) (< last-two 21)) :th
|
||||
(= last-one 1) :st
|
||||
(= last-one 2) :nd
|
||||
(= last-one 3) :rd
|
||||
:th)))
|
||||
|
||||
(fn nth [n]
|
||||
(.. n "'" (get-suffix n)))
|
||||
|
||||
(for [i 0 25]
|
||||
(print (nth i) (nth (+ i 250)) (nth (+ i 1000))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue