RosettaCodeData/Task/Hailstone-sequence/Jq/hailstone-sequence-2.jq

8 lines
278 B
Text
Raw Permalink Normal View History

2016-12-05 23:44:36 +01:00
[27|hailstone] as $h
| "[27|hailstone]|length is \($h|length)",
"The first four numbers: \($h[0:4])",
"The last four numbers: \($h|.[length-4:length])",
"",
max_hailstone(100000) as $m
| "Maximum length for n|hailstone for n in 1..100000 is \($m[1]) (n == \($m[0]))"