Hailstone sequence: Difference between revisions

m (→‎{{header|Go}}: just a little more idiomatic)
Line 1,361:
}</lang>
=={{header|Déjà Vu}}==
<lang dejavu>local hailstone:
swap [ over ]
while < 1 dup:
Line 1,372:
swap push-through rot dup
drop
 
if = (name) :(main):
local :h27 hailstone 27
. = 112 len h27
!. = 27112 h27!len 0h27
!. = 8227 h27! 10
!. = 4182 h27! 21
!. = 12441 h27! 32
!. = 8124 h27! 1083
!. = 48 h27! 109108
!. = 24 h27! 110109
!. = 12 h27! 111110
!. = 1 h27! 111
 
local :max 0
local :maxlenmax 0
local :maxmaxlen 0
for i range 1 99999:
dup len hailstone i
if < maxlen:
setif < :maxlen:
set :max imaxlen
set :max i
else:
dropelse:
drop
 
!print( "number: " to-str max ", length: " to-str maxlen )</lang>
else:
@hailstone</lang>
{{out}}
<pre>true
Anonymous user