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,49 +5,57 @@ challengeType: 5
forumTopicId: 302251
---
## Description
# --description--
<section id='description'>
Create a function, to compute the **[dot product](<https://en.wikipedia.org/wiki/Dot product>)**, also known as the **scalar product** of two vectors.
Create a function, to compute the <b><a href="https://en.wikipedia.org/wiki/Dot product">dot product</a></b>, also known as the <b>scalar product</b> of two vectors.
# --hints--
</section>
`dotProduct` should be a function.
## Instructions
<section id='instructions'>
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: <code>dotProduct</code> should be a function.
testString: assert(typeof dotProduct == 'function');
- text: <code>dotProduct([1, 3, -5], [4, -2, -1])</code> should return a number.
testString: assert(typeof dotProduct([1, 3, -5], [4, -2, -1]) == 'number');
- text: <code>dotProduct([1, 3, -5], [4, -2, -1])</code> should return <code>3</code>.
testString: assert.equal(dotProduct([1, 3, -5], [4, -2, -1]), 3);
- text: <code>dotProduct([1, 2, 3, 4, 5], [6, 7, 8, 9, 10])</code> should return <code>130</code>.
testString: assert.equal(dotProduct([1, 2, 3, 4, 5], [6, 7, 8, 9, 10]), 130);
- text: <code>dotProduct([5, 4, 3, 2], [7, 8, 9, 6])</code> should return <code>106</code>.
testString: assert.equal(dotProduct([5, 4, 3, 2], [7, 8, 9, 6]), 106);
- text: <code>dotProduct([-5, 4, -3, 2], [-7, -8, 9, -6])</code> should return <code>-36</code>.
testString: assert.equal(dotProduct([-5, 4, -3, 2], [-7, -8, 9, -6]), -36);
- text: <code>dotProduct([17, 27, 34, 43, 15], [62, 73, 48, 95, 110])</code> should return <code>10392</code>.
testString: assert.equal(dotProduct([17, 27, 34, 43, 15], [62, 73, 48, 95, 110]), 10392);
```js
assert(typeof dotProduct == 'function');
```
</section>
`dotProduct([1, 3, -5], [4, -2, -1])` should return a number.
## Challenge Seed
```js
assert(typeof dotProduct([1, 3, -5], [4, -2, -1]) == 'number');
```
<section id='challengeSeed'>
`dotProduct([1, 3, -5], [4, -2, -1])` should return `3`.
<div id='js-seed'>
```js
assert.equal(dotProduct([1, 3, -5], [4, -2, -1]), 3);
```
`dotProduct([1, 2, 3, 4, 5], [6, 7, 8, 9, 10])` should return `130`.
```js
assert.equal(dotProduct([1, 2, 3, 4, 5], [6, 7, 8, 9, 10]), 130);
```
`dotProduct([5, 4, 3, 2], [7, 8, 9, 6])` should return `106`.
```js
assert.equal(dotProduct([5, 4, 3, 2], [7, 8, 9, 6]), 106);
```
`dotProduct([-5, 4, -3, 2], [-7, -8, 9, -6])` should return `-36`.
```js
assert.equal(dotProduct([-5, 4, -3, 2], [-7, -8, 9, -6]), -36);
```
`dotProduct([17, 27, 34, 43, 15], [62, 73, 48, 95, 110])` should return `10392`.
```js
assert.equal(dotProduct([17, 27, 34, 43, 15], [62, 73, 48, 95, 110]), 10392);
```
# --seed--
## --seed-contents--
```js
function dotProduct(ary1, ary2) {
@ -55,12 +63,7 @@ function dotProduct(ary1, ary2) {
}
```
</div>
</section>
## Solution
<section id='solution'>
# --solutions--
```js
function dotProduct(ary1, ary2) {
@ -69,5 +72,3 @@ function dotProduct(ary1, ary2) {
return dotprod;
}
```
</section>