|
< /dev/random tr -cd '0-9' | fold -w 1 | jq -Mn '
|
|
|
|
# Output: a PRN in range(0;$n) where $n is .
|
|
def prn:
|
|
if . == 1 then 0
|
|
else . as $n
|
|
| (($n-1)|tostring|length) as $w
|
|
| [limit($w; inputs)] | join("") | tonumber
|
|
| if . < $n then . else ($n | prn) end
|
|
end;
|
|
|
|
100 | prn
|
|
'
|