lib/recursive.rb in cartesian-0.5.0 vs lib/recursive.rb in cartesian-0.5.2
- old
+ new
@@ -1,4 +1,6 @@
+# encoding: UTF-8
+
# Code by Brian Schröäer
# source: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/151857
#
def cartprod(base, *others)
return base.map { |a| [a] } if others.empty?