fork download
  1. factorial = (1..10).inject(Object) {|p,n| Class.new(p) {define_method("a#{n}") {n}}}.new
  2.  
  3. puts (1..10).map {|n| factorial.send("a#{n}")}.inject(:*)
Success #stdin #stdout 0.01s 7468KB
stdin
Standard input is empty
stdout
3628800