From a30e530e70672f6eeacb280089f515744c7c0981 Mon Sep 17 00:00:00 2001 From: Tomohiro Nishimura Date: Thu, 25 Mar 2010 17:04:31 +0900 Subject: [PATCH] add forgotten options to square_root_arithmetic generator --- lib/mint/generator/square_root_arithmetic.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/mint/generator/square_root_arithmetic.rb b/lib/mint/generator/square_root_arithmetic.rb index 01eba86..fbdcbe7 100644 --- a/lib/mint/generator/square_root_arithmetic.rb +++ b/lib/mint/generator/square_root_arithmetic.rb @@ -44,8 +44,10 @@ module Mint::Generator option :min, 0 option :max, 20 + option :upper_limit, 20 option :operators, %w[ * ] option :use_power, false + option :use_coefficient, false option :single_term_min, 2 option :single_term_max, 2 @@ -70,7 +72,7 @@ module Mint::Generator results.sort! if results.all? {|r| /sqrt/ !~ r } results.delete_at rand(results.length) - swap_options_with(:min => 2) do + swap_options_with(:min => 2, :max => options[:upper_limit]) do results << create_square_root_number end end -- 2.11.0