From: Robert Klemme Date: 2010-04-01T21:56:32+09:00 Subject: Re: Ruby solve classic math problem: make 56 from four 4s 2010/3/31 Kelly Jones : > A classic math problem asks "using only four 4s and any > mathematical operation, come up with the number > 56". "4!+4!+4+4" is one of probably several answers [1]. > > I want to write a ruby program that solves the > generalization: "given X number of the digit Y and a > set of permitted mathematical operations/functions, can > you come up with the number Z?" As long as you do not limit the number of unary operations that program is not guaranteed to terminate - especially if there is no solution for given X, Y and Z. Am I missing something? It should be interesting to see what solution strategy you are picking. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/