Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (19 sloc) 574 Bytes
require_relative 'extend_enum'
require_relative 'request'
NUMBER_OF_TRIALS = 100
DIGIT_LENGTH_RANGE = (10..70)
SEARCH_TERMS = DIGIT_LENGTH_RANGE.map do |i|
'?' * i
end
puts "NUMBER_OF_TRIALS: #{NUMBER_OF_TRIALS}"
puts "DIGIT_LENGTH_RANGE: #{DIGIT_LENGTH_RANGE}"
puts 'Running Trials...'
request = Request.new
results = request.trials(SEARCH_TERMS, NUMBER_OF_TRIALS)
puts 'Exporting results to csv...'
File.open('tmp/find_digits.csv', 'w') do |file|
results.each do |term, values|
file.write "#{term.scan('?').count},#{values.mean}\n"
end
puts file.path
end
You can’t perform that action at this time.