Anonymous user
Index finite lists of positive integers: Difference between revisions
Index finite lists of positive integers (view source)
Revision as of 21:11, 13 May 2014
, 10 years ago→Tacit versions
(→{{header|Perl 6}}: not using Test on second thought) |
|||
Line 160:
Base 11 encoding:
<lang j> rank =. 11&#.@:}.@:>@:(,&:>/)@:(<@:(10&,)@:(10&#.^:_1)"0)@:x:
unrank=. 10&#.;._1@:(10&,)@:(11&#.^:_1)</lang>
Example use:
<lang J> rank 1 2 3 10 100 987654321 135792468107264516704251 7x
187573177082615698496949025806128189691804770100426
unrank 187573177082615698496949025806128189691804770100426x
1 2 3 10 100 987654321 135792468107264516704251 7</lang>
|