Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added usage message

  • Loading branch information...
commit 90d9b49e6bd2065a8914c01b02a7de768c5efa11 1 parent 5128845
@szeryf authored
Showing with 16 additions and 0 deletions.
  1. +16 −0 kakuro.rb
View
16 kakuro.rb
@@ -4,6 +4,22 @@ def sum
end
end
+if ARGV.size == 0
+ puts "
+Usage:
+ ruby kakuro.rb s n [m]
+ where
+ s is the sum,
+ n is the digits number,
+ m is the list of digits that are already known to be present in this sum.
+For example:
+ ruby kakuro.rb 20 4 3 6
+prints all the 4-digit combinations where sum is 20 and the digits 3 and 6 are present.
+
+"
+ exit
+end
+
sum = ARGV.shift.to_i
num = ARGV.shift.to_i
must = ARGV.map { |a| a.to_i }
Please sign in to comment.
Something went wrong with that request. Please try again.