Sha256: f4585ea01eeb282614daeb7cc5ccd450dec9d2141742c77b1786c7fdb02cd587

Contents?: true

Size: 211 Bytes

Versions: 1

Compression:

Stored size: 211 Bytes

Contents

module LemonadeStand

  class RainEvent < Event

    def chance_of_rain
      (rand * 0.5 + 0.3).round(2)
    end

    def modify choice
      ((1 - chance_of_rain) * choice.max_sales).round
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lemonade_stand-0.0.1 lib/lemonade_stand/events/rain_event.rb