guide to the solution
-
race.rb - original solution driver, just call it like
ruby race.rb DISTANCE
-
race-stat.rb - Monte Carlo race, call like
ruby race-stat.rb
, stop the competition by issuing INT signal (Ctrl+C on most sane systems). This version will run multiple races and collect simple statistics to prove Cat's superiority over Dog. -
race-sim.rb - solution using discrete event simulation - makes little sense in the simple case as formulated, but could be useful if the animals were more alive and get tired or agitated and their speed would vary from leap to leap. Call it like
ruby race-sim.rb DISTANCE
-
html/index.html - visualisation of the race using javascript and paper.js. The algorithm combines overshooting formula form (1) and a very simple animation system. Distance depends on browser width, race can be restarted by clicking anywhere or resizing the window.
paperless receipts engineering jobs
We're looking for passionate people who think outside the box. People who are passionate about solving real-life problems. Our goal is to encourage and empower to do their best, collaboratively and individually. We value personal and professional growth and reward attention to detail.
Here's how to apply:
- Solve the challenge below.
- Fork this repo with your solution
- Include your resume if available in the repo
- Mention any apps you've built or projects you've enjoyed working on
- Should clippy be brought back?
The Challenge:
A trained cat and dog run a race, one hundred feet straight away and return. The dog leaps three feet at each bound and the cat but two, but then she makes three leaps to his two. Now, under those circumstances, who wins the race?
Input
The race distance eg 100, 200
Output
{Animal} wins by {distance}
Cat wins by 50 feet Dog wins by 10 feet or Draw
We will get back to you within a week of submitting your solution