Commits

Anonymous committed 06e0512

Added the kakuro-perms.rb with the check-perms.rb.

Comments (0)

Files changed (3)

solver/ruby/Makefile

+all:
+
+test:
+	spec t/*.rb

solver/ruby/kakuro-perms.rb

+module Kakuro
+    class Perms
+        
+        def human_to_internal(sum, num)
+            return [sum-num, num]
+        end
+    end
+end

solver/ruby/t/check-perms.rb

+require "kakuro-perms.rb"
+
+describe "Kakuro" do
+    before do
+        @perm = Kakuro::Perms.new
+    end
+
+    it "human->internal transform for 3/2" do
+        @perm.human_to_internal(3,2).should eql([1,2])
+    end
+
+end