Sha256: e967efa77895a98b34bddb05a245fa777fa8156df158c139ef6cd3bf584cb7cd

Contents?: true

Size: 305 Bytes

Versions: 11

Compression:

Stored size: 305 Bytes

Contents

require File.dirname(__FILE__) + '/example_helper'

class EquationProblem
  include Gecode::Mixin

  def initialize
    x, y, z = vars_is_an int_var_array(3, 0..9)

    (x + y).must == z
    x.must == y - 3

    branch_on vars
  end
end

puts 'x y z'
puts EquationProblem.new.solve!.vars.values.join(' ')

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
gecoder-with-gecode-1.1.1.1 example/equation_system.rb
gecoder-with-gecode-1.1.1 example/equation_system.rb
gecoder-1.1.1 example/equation_system.rb
gecoder-with-gecode-1.1.0 example/equation_system.rb
gecoder-1.1.0 example/equation_system.rb
gecoder-1.0.0 example/equation_system.rb
gecoder-0.9.1 example/equation_system.rb
gecoder-with-gecode-0.9.1-x86-mswin32-60 example/equation_system.rb
gecoder-with-gecode-0.9.1 example/equation_system.rb
gecoder-with-gecode-1.0.0-x86-mswin32-60 example/equation_system.rb
gecoder-with-gecode-1.0.0 example/equation_system.rb