function nTosses = gap ( N )

%% gap plays one "gap N" game.

  Heads = 0; 
  Tails = 0; 
  nTosses = 0;

  while ( abs ( Heads - Tails ) < N )

    nTosses = nTosses + 1;

    if ( rand ( ) < 0.5 )
      Heads = Heads + 1;
    else
      Tails = Tails + 1;
    end

  end

  return
 end