function step = bicycle_lock ( c )

%*****************************************************************************80
%
%% BICYCLE_LOCK finds the combination on a typical bicycle lock.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license. 
%
%  Modified:
%
%    14 August 2017
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, integer C, the combination, a value between 0 and 999.
%
%    Output, integer STEP, the step on which the combination was found.
%
  step = 0;
%
%  To find the combination, simply generate every number between 0 and 999,
%  and then try it.
%
  for a = 0 : 999

    step = step + 1;

    if ( a == c )
      fprintf ( 1, '\n' );
      fprintf ( 1, '  The combination is %d!\n', c );
      return;
    end
  
  end

  step = -1;

  return
end

