From: Intransition Date: 2011-12-25T22:27:33+09:00 Subject: How to Combo ------=_Part_1232_10327217.1324819650403 Content-Type: multipart/alternative; boundary="----=_Part_1233_26015734.1324819650403" ------=_Part_1233_26015734.1324819650403 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Easiest implementation of "some_method" in Ruby? a = %w|a b| b = %w|a x| c = %w|x y| some_method(a,b,c) #=> [ ["a", "a", "x"] ["a", "a", "y"] ["a", "x", "x"] ["a", "x", "y"] ["b", "a", "x"] ["b", "a", "y"] ["b", "x", "x"] ["b", "x", "y"] ] Order doesn't really matter. ------=_Part_1233_26015734.1324819650403 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
Easiest implementation of "some_method" in Ruby?

     a = %w|a b|
     b = %w|a x|
     c = %w|x y|

  some_method(a,b,c)

  #=>

   [ ["a", "a", "x"]
     ["a", "a", "y"]
     ["a", "x", "x"]
     ["a", "x", "y"]
     ["b", "a", "x"]
     ["b", "a", "y"]
     ["b", "x", "x"]
     ["b", "x", "y"] ]
  
Order doesn't really matter.

------=_Part_1233_26015734.1324819650403-- ------=_Part_1232_10327217.1324819650403--