function hail1 ( )

%% HAIL1 computes 10,000 hailstone numbers and plots them.

  tic

  hold on

  for i = 1 : 10000

    x = i;
    y = x;
    z = 0;

    while ( 1 ~= y )
      z = z + 1;
      if ( mod ( y, 2 ) == 1 )
        y = 3 * y + 1;
      else
        y = y / 2;
      end
    end

    plot ( x, z, 'g*' )

  end

  title ( 'HAIL1' )

  hold off

  toc

  return
end
