Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
14
Task/Nth/Factor/nth.factor
Normal file
14
Task/Nth/Factor/nth.factor
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
USING: io kernel math math.order math.parser math.ranges qw
|
||||
sequences ;
|
||||
IN: rosetta-code.nth
|
||||
|
||||
: n'th ( n -- str )
|
||||
dup 10 /mod swap 1 = [ drop 0 ] when
|
||||
[ number>string ]
|
||||
[ 4 min qw{ th st nd rd th } nth ] bi* append ;
|
||||
|
||||
: n'th-demo ( -- )
|
||||
0 25 250 265 1000 1025 [ [a,b] ] 2tri@
|
||||
[ [ n'th write bl ] each nl ] tri@ ;
|
||||
|
||||
MAIN: n'th-demo
|
||||
Loading…
Add table
Add a link
Reference in a new issue