examples/example.rb
# version with global variable -- counts calls to #choose
version with global variable -- counts calls to #choose
version with global variable -- counts calls to #choose
def try_combinations
  i = 0
  first = Ambit.choose(1..10)
  i += 1
  second = Ambit.choose(1..10)
  i += 1
  third = Ambit.choose(1..10)
  i += 1
  Ambit.fail! unless open_lock(first, second, third)
  i
end
def try_combinations i = 0 first = Ambit . choose ( 1 .. 10 ) i += 1 second = Ambit . choose ( 1 .. 10 ) i += 1 third = Ambit . choose ( 1 .. 10 ) i += 1 Ambit . fail! unless open_lock ( first , second , third ) i end
version with global variable -- counts calls to #choose
version with global variable -- counts calls to #choose