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))))
|
||||
47
Task/Nth/Refal/nth.refal
Normal file
47
Task/Nth/Refal/nth.refal
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
$ENTRY Go {
|
||||
= <Show 0 25>
|
||||
<Show 250 265>
|
||||
<Show 1000 1025>;
|
||||
};
|
||||
|
||||
Nth {
|
||||
s.N, <Symb s.N>: {
|
||||
e.X '1' s.Y = e.X '1' s.Y 'th';
|
||||
e.X '1' = e.X '1st';
|
||||
e.X '2' = e.X '2nd';
|
||||
e.X '3' = e.X '3rd';
|
||||
e.X = e.X 'th';
|
||||
};
|
||||
};
|
||||
|
||||
Cell {
|
||||
s.N, <First 8 <Nth s.N> ' '>: (e.1) e.2 = e.1;
|
||||
}
|
||||
|
||||
Group {
|
||||
s.N e.1 = <Group (s.N s.N) () e.1>;
|
||||
(s.N s.M) (e.1) = (e.1);
|
||||
(s.N 0) (e.1) e.2 = (e.1) <Group (s.N s.N) () e.2>;
|
||||
(s.N s.M) (e.1) s.2 e.3 = <Group (s.N <- s.M 1>) (e.1 s.2) e.3>;
|
||||
};
|
||||
|
||||
Iota {
|
||||
s.End s.End = s.End;
|
||||
s.Start s.End = s.Start <Iota <+ s.Start 1> s.End>;
|
||||
};
|
||||
|
||||
Each {
|
||||
s.F = ;
|
||||
s.F t.I e.X = <Mu s.F t.I> <Each s.F e.X>;
|
||||
};
|
||||
|
||||
ShowLine {
|
||||
(e.Line) = <Prout <Each Cell e.Line>>;
|
||||
};
|
||||
|
||||
Show {
|
||||
s.Start s.End,
|
||||
<Iota s.Start s.End>: e.Range,
|
||||
<Group 10 e.Range>: e.Lines
|
||||
= <Prout <Each ShowLine e.Lines>>;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue