Geohash: Difference between revisions

Content added Content deleted
m (→‎{{header|jq}}: simplify)
Line 410: Line 410:
def stream:
def stream:
recurse(if . >= base then ./base|floor else empty end) | . % base ;
recurse(if . >= base then ./base|floor else empty end) | . % base ;
[stream] | reverse | .[1:]
[stream] | reverse
| if base < 10 then map(tostring) | join("")
| if base < 10 then map(tostring) | join("")
elif base <= 36 then map(if . < 10 then 48 + . else . + 87 end) | implode
elif base <= 36 then map(if . < 10 then 48 + . else . + 87 end) | implode