Skip to content

Instantly share code, notes, and snippets.

@greglu
Created November 9, 2009 04:54
Show Gist options
  • Select an option

  • Save greglu/229701 to your computer and use it in GitHub Desktop.

Select an option

Save greglu/229701 to your computer and use it in GitHub Desktop.
max_function = ""
6.times do |i|
6.times do |j|
max_function << ((rand(2) == 1) ? " + " : " - ")
max_function << "#{rand(20)}*x#{i+1}#{j+1}"
end
end
puts ((max_function[0..2] == " + ") ? max_function[3..(max_function.size-1)] : max_function)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment