Sha256: 12da6012f367fb9d3f0fd452143527c0808e88659fe072e1e49ec5f56239bf32

Contents?: true

Size: 296 Bytes

Versions: 3

Compression:

Stored size: 296 Bytes

Contents

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

class EquationProblem < Gecode::Model
  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

3 entries across 3 versions & 2 rubygems

Version Path
gecoder-0.9.0 example/equation_system.rb
gecoder-with-gecode-0.9.0-x86-mswin32-60 example/equation_system.rb
gecoder-with-gecode-0.9.0 example/equation_system.rb