Index finite lists of positive integers: Difference between revisions

(→‎{{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
10859468893418553562739357752202339093235635587121336
unrank 187573177082615698496949025806128189691804770100426x
unrank 10859468893418553562739357752202339093235635587121336x
1 2 3 10 100 987654321 135792468107264516704251 7</lang>
 
Anonymous user