Hailstone sequence: Difference between revisions
m
→{{header|FutureBasic}}: Tweak indents again
m (→{{header|FutureBasic}}: Inserted code indents) |
m (→{{header|FutureBasic}}: Tweak indents again) |
||
Line 4,559:
<syntaxhighlight lang="futurebasic">
local fn Hailstone( n as NSInteger ) as NSInteger
NSInteger count = 1
while ( n != 1 )
if ( n and 1 ) == 1
n = n * 3 + 1
count++▼
end if
n = n / 2▼
count++
▲ n = n / 2
▲ count++
end fn = count
|