Index finite lists of positive integers: Difference between revisions

(→‎{{header|jq}}: C implementation limits)
Line 597:
changes would be required if using jaq as jaq does not (as of this writing in 2024) support
the `include` or `module` directives.
===Bijective mapMap based on Fibonacci encoding===
<syntaxhighlight lang="jq">
include "fibonacci" {search: "./"}; # see https://rosettacode.org/wiki/Category:Jq/fibonacci.jq
Line 665:
}
</pre>
 
'''Stretch task'''
For the integers from 1 to 10 inclusive, the "unranked" values are shown by the following output, in which the third value on each line confirms the round-trip via "rank":
<pre>
[1,[0],1]
[2,[1],2]
[3,[0,0],3]
[4,[2],4]
[5,[1,0],5]
[6,[0,1],6]
[7,[0,0,0],7]
[8,[3],8]
[9,[2,0],9]
[10,[1,1],10]
</pre>
See the "illustration" paragraph in the following subsection for details.
 
===Bijective map based on "n 0s" encoding===
2,455

edits