Files
freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-227-the-chase.md
Oliver Eyton-Williams ee1e8abd87 feat(curriculum): restore seed + solution to Chinese (#40683)
* feat(tools): add seed/solution restore script

* chore(curriculum): remove empty sections' markers

* chore(curriculum): add seed + solution to Chinese

* chore: remove old formatter

* fix: update getChallenges

parse translated challenges separately, without reference to the source

* chore(curriculum): add dashedName to English

* chore(curriculum): add dashedName to Chinese

* refactor: remove unused challenge property 'name'

* fix: relax dashedName requirement

* fix: stray tag

Remove stray `pre` tag from challenge file.

Signed-off-by: nhcarrigan <nhcarrigan@gmail.com>

Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
2021-01-12 19:31:00 -07:00

43 lines
1.0 KiB
Markdown

---
id: 5900f44f1000cf542c50ff61
title: 'Problem 227: The Chase'
challengeType: 5
forumTopicId: 301870
dashedName: problem-227-the-chase
---
# --description--
"The Chase" is a game played with two dice and an even number of players.
The players sit around a table; the game begins with two opposite players having one die each. On each turn, the two players with a die roll it. If a player rolls a 1, he passes the die to his neighbour on the left; if he rolls a 6, he passes the die to his neighbour on the right; otherwise, he keeps the die for the next turn. The game ends when one player has both dice after they have been rolled and passed; that player has then lost.
In a game with 100 players, what is the expected number of turns the game lasts? Give your answer rounded to ten significant digits.
# --hints--
`euler227()` should return 3780.618622.
```js
assert.strictEqual(euler227(), 3780.618622);
```
# --seed--
## --seed-contents--
```js
function euler227() {
return true;
}
euler227();
```
# --solutions--
```js
// solution required
```