mirror of
https://github.com/samsonjs/mystery7-simulator.git
synced 2026-04-27 15:07:42 +00:00
add (commented) code to dump results to a CSV file
This commit is contained in:
parent
3bf39f90af
commit
4ea9183426
1 changed files with 11 additions and 0 deletions
11
simulate.rb
11
simulate.rb
|
|
@ -31,6 +31,8 @@ def main
|
|||
:wins => 0
|
||||
}
|
||||
|
||||
# all_results = []
|
||||
|
||||
options[:sessions].times do
|
||||
|
||||
roulette.simulate
|
||||
|
|
@ -60,12 +62,21 @@ def main
|
|||
puts "Snakes: #{status[:snakes]}"
|
||||
end
|
||||
|
||||
# all_results += roulette.results
|
||||
|
||||
end
|
||||
|
||||
puts "Net profit: #{overall_status[:net]}"
|
||||
puts "Wins: #{overall_status[:wins]}"
|
||||
puts "Snakes: #{overall_status[:snakes]}"
|
||||
|
||||
# File.open(File.expand_path('~/Dropbox/Mystery7/results.csv'), 'w') do |f|
|
||||
# f.puts('Roll, Net, Cumulative Net')
|
||||
# all_results.each do |result|
|
||||
# f.puts("#{result[:roll]}, #{result[:net]}, #{result[:cumulative_net]}")
|
||||
# end
|
||||
# end
|
||||
|
||||
puts ">>> Results are in #{options[:database]}." if options[:record]
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue