This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby '2.7.1' | |
gem 'rails', github: 'rails/rails' | |
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data | |
# Action Text | |
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra' | |
gem 'okra', github: 'basecamp/okra' | |
# Drivers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# inspired by Matt Parker's Frog Problem video | |
# https://www.youtube.com/watch?v=ZLTyX4zL2Fc | |
module Froggie | |
class << self | |
def calculate_average_jumps(n_frogs = 10_000, n_spots = 10) | |
total_jumps = 0.0 | |
n_frogs.times { total_jumps += Frog.new(n_spots).jump! } | |
total_jumps / n_frogs | |
end |