chore(i18n,curriculum): update translations (#43500)

This commit is contained in:
camperbot
2021-09-21 08:09:14 -07:00
committed by GitHub
parent 128d7a509d
commit b681dbfabe
8 changed files with 48 additions and 48 deletions

View File

@ -8,27 +8,27 @@ dashedName: 100-doors
# --description--
連續 100 個門都是最初關閉的。 You make 100 passes by the doors. The first time through, visit every door and 'toggle' the door (if the door is closed, open it; if it is open, close it). The second time, only visit every 2nd door (i.e., door #2, #4, #6, ...) and toggle it. The third time, visit every 3rd door (i.e., door #3, #6, #9, ...), etc., until you only visit the 100th door.
連續 100 個門都是最初關閉的。 你在門前通行了 100 次。 第一次通行時,訪問每扇門,並“切換”門(如果門是關閉的,就打開它;如果門是打開的,就關閉它)。 第二次,只訪問每個第二扇門(即門 #2#4#6...)並切換它們。 第三次,每三個門訪問一次(即門 #3#6#9...)等,直到你只訪問第 100 個門。
# --instructions--
Implement a function to determine the state of the doors after the last pass. Return the final result in an array, with only the door number included in the array if it is open.
實現一個函數,以確定最後一次通過後門的狀態。 以數組形式返回最終結果,數組中只包含打開的門的門號。
# --hints--
`getFinalOpenedDoors` should be a function.
`getFinalOpenedDoors` 應該是一個函數。
```js
assert(typeof getFinalOpenedDoors === 'function');
```
`getFinalOpenedDoors` should return an array.
`getFinalOpenedDoors` 應該返回一個數組。
```js
assert(Array.isArray(getFinalOpenedDoors(100)));
```
`getFinalOpenedDoors` should produce the correct result.
`getFinalOpenedDoors` 應該產生正確的結果。
```js
assert.deepEqual(getFinalOpenedDoors(100), solution);

View File

@ -1,6 +1,6 @@
---
id: 5951e88f64ebf159166a1176
title: 24 game
title: 24 點遊戲
challengeType: 5
forumTopicId: 302218
dashedName: 24-game
@ -8,23 +8,23 @@ dashedName: 24-game
# --description--
The [24 Game](https://en.wikipedia.org/wiki/24_Game) tests a person's mental arithmetic.
[24 點遊戲](https://en.wikipedia.org/wiki/24_Game)測試一個人的心算能力。
The aim of the game is to arrange four numbers in a way that when evaluated, the result is 24
遊戲的目標是使四個數字的計算結果是 24
# --instructions--
Implement a function that takes a string of four digits as its argument, with each digit from 1 to 9 (inclusive) with repetitions allowed, and returns an arithmetic expression that evaluates to the number 24. If no such solution exists, return "no solution exists".
實現一個函數,該函數將一個四位數的字符串作爲其參數,每個數字從 1 到 9並允許重複並返回一個計算結果爲數字 24 的算術表達式。 如果不存在這樣的解,則返回“沒有解決方案”。
**Rules:**
**規則:**
<ul>
<li> Only the following operators/functions are allowed: multiplication, division, addition, subtraction. </li>
<li> Division should use floating point or rational arithmetic, etc, to preserve remainders. </li>
<li> Forming multiple digit numbers from the supplied digits is disallowed. (So an answer of 12+12 when given 1, 2, 2, and 1 is wrong). </li>
<li> The order of the digits when given does not have to be preserved. </li>
<li> 只允許以下運算符/函數:乘法、除法、加法、減法。 </li>
<li> 除法應使用浮點或有理算術等來保留餘數。 </li>
<li> 不允許從提供的數字中形成多位數字。 (所以當給出 1、2、2 和 1 時12 + 12 的答案是錯誤的)。 </li>
<li> 不必依照給定的數字順序。 </li>
</ul>
| Example input | Example output |
| 示例輸入 | 示例輸出 |
| ------------------------- | ------------------------- |
| <code>solve24("4878");</code> | <code>(7-8/8)\*4</code> |
| <code>solve24("1234");</code> | <code>3\*1\*4\*2</code> |
@ -33,31 +33,31 @@ Implement a function that takes a string of four digits as its argument, with ea
# --hints--
`solve24` should be a function.
`solve24` 應該是一個函數。
```js
assert(typeof solve24 === 'function');
```
`solve24("4878")` should return `(7-8/8)*4` or `4*(7-8/8)`
`solve24("4878")` 應該返回 `(7-8/8)*4` `4*(7-8/8)`
```js
assert(include(answers[0], removeParentheses(solve24(testCases[0]))));
```
`solve24("1234")` should return any arrangement of `1*2*3*4`
`solve24("1234")` 應該返回 `1*2*3*4`
```js
assert(include(answers[1], removeParentheses(solve24(testCases[1]))));
```
`solve24("6789")` should return `(6*8)/(9-7)` or `(8*6)/(9-7)`
`solve24("6789")` 應該返回 `(6*8)/(9-7)` `(8*6)/(9-7)`
```js
assert(include(answers[2], removeParentheses(solve24(testCases[2]))));
```
`solve24("1127")` should return a permutation of `(1+7)*(1+2)`
`solve24("1127")` 應該返回 `(1+7)*(1+2)`
```js
assert(include(answers[3], removeParentheses(solve24(testCases[3]))));