Advertisement
t_a_w

Color to number

Apr 19th, 2016
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.30 KB | None | 0 0
  1. #!/usr/bin/env ruby
  2.  
  3. require "z3"
  4.  
  5. b = Z3.Int("b")
  6. w = Z3.Int("w")
  7. g = Z3.Int("g")
  8. r = Z3.Int("r")
  9.  
  10. solver = Z3::Solver.new
  11.  
  12. solver.assert b+w == g
  13. solver.assert b*r == w
  14. solver.assert w-r == r
  15. solver.assert b*4 == g
  16. solver.assert Z3.Distinct(b,w,r,g)
  17.  
  18. p solver.check
  19. puts solver.model
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement