chore(learn): Applied MDX format to Chinese curriculum files (#40462)

This commit is contained in:
Randell Dawson
2020-12-16 00:37:30 -07:00
committed by GitHub
parent 873fce02a2
commit 9ce4a02a41
1665 changed files with 58741 additions and 88042 deletions

View File

@ -1,67 +1,39 @@
---
id: 59f40b17e79dbf1ab720ed7a
title: 部门编号
challengeType: 5
videoUrl: ''
title: 部门编号
---
## Description
<section id="description"><p>有一个高度组织化的城市决定为每个部门分配一个号码: </p>警察局环卫部门消防部门<p>每个部门的数字可以在1到7之间</p><p>这三个部门编号应该是唯一的彼此不同并且必须加起来为12。 </p><p>警察局长不喜欢奇怪的号码,并希望他的部门有一个偶数。 </p>任务: <p>编写一个输出所有有效组合的程序: </p><p> [2,3,7] </p><p> [2,4,6] </p><p> [2,6,4] </p><p> [2,7,3] </p><p> [4,1,7] </p><p> [4,2,6] </p><p> [4,3,5] </p><p> [4,5,3] </p><p> [4,6,2] </p><p> [4,7,1] </p><p> [6,1,5] </p><p> [6,2,4] </p><p> [6,4,2] </p><p> [6,5,1] </p></section>
# --description--
## Instructions
<section id="instructions">
</section>
<p>有一个高度组织化的城市决定为每个部门分配一个号码: </p>警察局环卫部门消防部门<p>每个部门的数字可以在1到7之间</p><p>这三个部门编号应该是唯一的彼此不同并且必须加起来为12。 </p><p>警察局长不喜欢奇怪的号码,并希望他的部门有一个偶数。 </p>任务: <p>编写一个输出所有有效组合的程序: </p><p> [2,3,7] </p><p> [2,4,6] </p><p> [2,6,4] </p><p> [2,7,3] </p><p> [4,1,7] </p><p> [4,2,6] </p><p> [4,3,5] </p><p> [4,5,3] </p><p> [4,6,2] </p><p> [4,7,1] </p><p> [6,1,5] </p><p> [6,2,4] </p><p> [6,4,2] </p><p> [6,5,1] </p>
## Tests
<section id='tests'>
# --hints--
```yml
tests:
- text: <code>combinations</code>应该是一个功能。
testString: assert(typeof combinations === 'function');
- text: '<code>combinations([1, 2, 3], 6)</code>应该返回一个数组。'
testString: assert(Array.isArray(combinations([1, 2, 3], 6)));
- text: '<code>combinations([1, 2, 3, 4, 5, 6, 7], 12)</code>应返回长度为14的数组。'
testString: assert(combinations(nums, total).length === len);
- text: '<code>combinations([1, 2, 3, 4, 5, 6, 7], 12)</code>应返回所有有效组合。'
testString: assert.deepEqual(combinations(nums, total), result);
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
`combinations`应该是一个功能。
```js
function combinations (possibleNumbers, total) {
// Good luck!
return true;
}
assert(typeof combinations === 'function');
```
</div>
### After Test
<div id='js-teardown'>
`combinations([1, 2, 3], 6)`应该返回一个数组。
```js
console.info('after the test');
assert(Array.isArray(combinations([1, 2, 3], 6)));
```
</div>
</section>
## Solution
<section id='solution'>
`combinations([1, 2, 3, 4, 5, 6, 7], 12)`应返回长度为14的数组。
```js
// solution required
assert(combinations(nums, total).length === len);
```
/section>
`combinations([1, 2, 3, 4, 5, 6, 7], 12)`应返回所有有效组合。
```js
assert.deepEqual(combinations(nums, total), result);
```
# --solutions--