# Lujaw/paipr forked from olabini/paipr

1 parent 8a076aa commit 492cd4b6e830b1dd219912a95f5a17dafd335f48 olabini committed Sep 14, 2008
Showing with 48 additions and 0 deletions.
1. +11 −0 lib/ch04/blocks_problem3.rb
2. +12 −0 lib/ch04/blocks_problem4.rb
3. +12 −0 lib/ch04/blocks_problem5.rb
4. +13 −0 lib/ch04/blocks_problem6.rb
 @@ -0,0 +1,11 @@ +require 'blocks' +require 'pp' + +gps = GPS2.new([[:a, :on, :b], + [:b, :on, :c], + [:c, :on, :table], + [:space, :on, :a], + [:space, :on, :table]], + Blocks.make_ops([:a, :b, :c])) + +pp gps.solve([:c, :on, :b], [:b, :on, :a])
 @@ -0,0 +1,12 @@ +require 'blocks' +require 'pp' + +gps = GPS2.new([[:c, :on, :a], + [:a, :on, :table], + [:b, :on, :table], + [:space, :on, :b], + [:space, :on, :c], + [:space, :on, :table]], + Blocks.make_ops([:a, :b, :c])) + +pp gps.solve([:c, :on, :table])
 @@ -0,0 +1,12 @@ +require 'blocks' +require 'pp' + +gps = GPS2.new([[:c, :on, :a], + [:a, :on, :table], + [:b, :on, :table], + [:space, :on, :b], + [:space, :on, :c], + [:space, :on, :table]], + Blocks.make_ops([:a, :b, :c])) + +pp gps.solve([:c, :on, :table], [:a, :on, :b])
 @@ -0,0 +1,13 @@ +require 'blocks' +require 'pp' + +gps = GPS2.new([[:c, :on, :a], + [:a, :on, :table], + [:b, :on, :table], + [:space, :on, :c], + [:space, :on, :b], + [:space, :on, :table]], + Blocks.make_ops([:a, :b, :c])) + +pp gps.solve([:a, :on, :b], [:b, :on, :c]) +pp gps.solve([:b, :on, :c], [:a, :on, :b])