Feat: add new Markdown parser (#39800)

and change all the challenges to new `md` format.
This commit is contained in:
Oliver Eyton-Williams
2020-11-27 19:02:05 +01:00
committed by GitHub
parent a07f84c8ec
commit 0bd52f8bd1
2580 changed files with 113436 additions and 111979 deletions

View File

@ -5,10 +5,10 @@ challengeType: 5
forumTopicId: 302324
---
## Description
# --description--
For this task, the Stern-Brocot sequence is to be generated by an algorithm similar to that employed in generating the [Fibonacci sequence](<https://rosettacode.org/wiki/Fibonacci sequence>).
<section id='description'>
For this task, the Stern-Brocot sequence is to be generated by an algorithm similar to that employed in generating the <a href="https://rosettacode.org/wiki/Fibonacci sequence" target="_blank">Fibonacci sequence</a>.
<ol>
<li>The first and second members of the sequence are both 1:</li>
<ul><li>1, 1</li></ul>
@ -32,42 +32,58 @@ For this task, the Stern-Brocot sequence is to be generated by an algorithm simi
<ul><li>1, 1, 2, 1, 3, 2</li></ul>
<li>Consider the next member of the series, (the fourth member i.e. 1)</li>
</ol>
</section>
## Instructions
# --instructions--
<section id='instructions'>
Create a function that returns the $ n^{th} $ member of the sequence using the method outlined above.
</section>
## Tests
# --hints--
<section id='tests'>
`sternBrocot` should be a function.
```yml
tests:
- text: <code>sternBrocot</code> should be a function.
testString: assert(typeof sternBrocot == 'function');
- text: <code>sternBrocot(2)</code> should return a number.
testString: assert(typeof sternBrocot(2) == 'number');
- text: <code>sternBrocot(2)</code> should return <code>3</code>.
testString: assert.equal(sternBrocot(2), 3);
- text: <code>sternBrocot(3)</code> should return <code>5</code>.
testString: assert.equal(sternBrocot(3), 5);
- text: <code>sternBrocot(5)</code> should return <code>11</code>.
testString: assert.equal(sternBrocot(5), 11);
- text: <code>sternBrocot(7)</code> should return <code>19</code>.
testString: assert.equal(sternBrocot(7), 19);
- text: <code>sternBrocot(10)</code> should return <code>39</code>.
testString: assert.equal(sternBrocot(10), 39);
```js
assert(typeof sternBrocot == 'function');
```
</section>
`sternBrocot(2)` should return a number.
## Challenge Seed
```js
assert(typeof sternBrocot(2) == 'number');
```
<section id='challengeSeed'>
<div id='js-seed'>
`sternBrocot(2)` should return `3`.
```js
assert.equal(sternBrocot(2), 3);
```
`sternBrocot(3)` should return `5`.
```js
assert.equal(sternBrocot(3), 5);
```
`sternBrocot(5)` should return `11`.
```js
assert.equal(sternBrocot(5), 11);
```
`sternBrocot(7)` should return `19`.
```js
assert.equal(sternBrocot(7), 19);
```
`sternBrocot(10)` should return `39`.
```js
assert.equal(sternBrocot(10), 39);
```
# --seed--
## --seed-contents--
```js
function sternBrocot(num) {
@ -75,12 +91,7 @@ function sternBrocot(num) {
}
```
</div>
</section>
## Solution
<section id='solution'>
# --solutions--
```js
function sternBrocot(num) {
@ -100,5 +111,3 @@ function sternBrocot(num) {
return n;
}
```
</section>