chore(i18n,curriculum): update translations (#43157)
This commit is contained in:
@ -9,7 +9,7 @@ dashedName: adjust-the-tone-of-a-color
|
||||
|
||||
# --description--
|
||||
|
||||
`hsl()` 使 CSS 更改顏色色調更加方便。 比如,給一個純色添加白色可以調出更淺的色調;添加黑色可以創造更深的色調。 另外,還可以通過給純色添加灰色來同時改變顏色的深淺和明暗。 回憶下 `hsl()` 裏面的 ‘s’ 和 ‘l’ 分辨代表飽和度和亮度。 飽和度代表灰色的佔比,亮度代表白色和黑色的佔比。 這在你想獲取一個基準色的變種的情景下會十分有用。
|
||||
`hsl()` 使 CSS 更改顏色色調更加方便。 比如,給一個純色添加白色可以調出更淺的色調;添加黑色可以創造更深的色調。 另外,還可以通過給純色添加灰色來同時改變顏色的深淺和明暗。 回憶下 `hsl()` 裏面的 ‘s’ 和 ‘l’ 分別代表飽和度和亮度。 飽和度代表灰色的佔比,亮度代表白色和黑色的佔比。 這在你想獲取一個基準色的變種的情景下會十分有用。
|
||||
|
||||
# --instructions--
|
||||
|
||||
|
@ -15,25 +15,25 @@ dashedName: divide-the-grid-into-an-area-template
|
||||
grid-template-areas:
|
||||
"header header header"
|
||||
"advert content content"
|
||||
"footer footer footer";
|
||||
"advert footer footer";
|
||||
```
|
||||
|
||||
上面的代碼將頂部三個單元格合併成一個名爲 `header` 的區域,將底部三個單元格合併爲一個名爲 `footer` 的區域,並在中間行創建了兩個區域:`advert` 和 `content`。 **注意:**在代碼中,每個單詞代表一個網格單元格,每對引號代表一行。 除了自定義標籤,你還能使用句點(`.`)來表示一個空單元格。
|
||||
上面的代碼將網格單元格分成四個區域:`header`、`advert`、`content` 和 `footer`。 每個單詞代表一個單元格,每對引號代表一行。
|
||||
|
||||
# --instructions--
|
||||
|
||||
請放置區域模板,讓名爲 `advert` 的區域變成空單元格。
|
||||
更改模板,使 `footer` 區域跨越整個底部行。 定義區域現在不會有任何可視效果。 稍後,你將使用一個區域來查看它的工作方式。
|
||||
|
||||
# --hints--
|
||||
|
||||
class 爲 `container` 的元素應具有 `grid-template-areas` 屬性,在其屬性值中,應使用 `.` 代替 `advert`。
|
||||
class 爲 `container` 的元素應具有 `grid-template-areas` 屬性,和示例類似,但是 `footer` 區域跨越整個底部行。
|
||||
|
||||
```js
|
||||
assert(
|
||||
__helpers
|
||||
.removeCssComments(code)
|
||||
.match(
|
||||
/.container\s*?{[\s\S]*grid-template-areas\s*?:\s*?"\s*?header\s*?header\s*?header\s*?"\s*?"\s*?.\s*?content\s*?content\s*?"\s*?"\s*?footer\s*?footer\s*?footer\s*?"\s*?;[\s\S]*}/gi
|
||||
/.container\s*?{[\s\S]*grid-template-areas\s*?:\s*?"\s*?header\s*?header\s*?header\s*?"\s*?"\s*?advert\s*?content\s*?content\s*?"\s*?"\s*?footer\s*?footer\s*?footer\s*?"\s*?;[\s\S]*}/gi
|
||||
)
|
||||
);
|
||||
```
|
||||
@ -63,7 +63,7 @@ assert(
|
||||
/* Only change code below this line */
|
||||
"header header header"
|
||||
"advert content content"
|
||||
"footer footer footer";
|
||||
"advert footer footer";
|
||||
/* Only change code above this line */
|
||||
}
|
||||
</style>
|
||||
@ -99,7 +99,7 @@ assert(
|
||||
|
||||
grid-template-areas:
|
||||
"header header header"
|
||||
". content content"
|
||||
"advert content content"
|
||||
"footer footer footer";
|
||||
}
|
||||
</style>
|
||||
|
@ -38,6 +38,12 @@ assert(
|
||||
);
|
||||
```
|
||||
|
||||
`zeroArray(4,3)` 應該返回一個包含 4 行、每行 3 列零的數組。
|
||||
|
||||
```js
|
||||
assert(JSON.stringify(zeroArray(4,3)) == '[[0,0,0],[0,0,0],[0,0,0],[0,0,0]]');
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
## --seed-contents--
|
||||
@ -62,6 +68,7 @@ function zeroArray(m, n) {
|
||||
|
||||
let matrix = zeroArray(3, 2);
|
||||
console.log(matrix);
|
||||
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
@ -86,4 +93,5 @@ function zeroArray(m, n) {
|
||||
|
||||
let matrix = zeroArray(3, 2);
|
||||
console.log(matrix);
|
||||
|
||||
```
|
||||
|
@ -10,7 +10,7 @@ dashedName: match-all-letters-and-numbers
|
||||
|
||||
使用元字符,可以使用 `[a-z]` 搜尋字母表中的所有字母。 這種元字符是很常見的,它有一個縮寫,但這個縮寫也包含額外的字符。
|
||||
|
||||
JavaScript 中與字母表匹配的最接近的元字符是`\w`。 這個縮寫等同於`[A-Za-z0-9_]`。 此字符類匹配上面字母和小寫字母以及數字。 注意,這個字符類也包含下劃線字符 (`_`)。
|
||||
JavaScript 中與字母表匹配的最接近的元字符是`\w`。 這個縮寫等同於`[A-Za-z0-9_]`。 此字符類匹配大寫字母和小寫字母以及數字。 注意,這個字符類也包含下劃線字符 (`_`)。
|
||||
|
||||
```js
|
||||
let longHand = /[A-Za-z0-9_]+/;
|
||||
|
@ -9,7 +9,7 @@ dashedName: adjust-the-tone-of-a-color
|
||||
|
||||
# --description--
|
||||
|
||||
`hsl()` 使 CSS 更改颜色色调更加方便。 比如,给一个纯色添加白色可以调出更浅的色调;添加黑色可以创造更深的色调。 另外,还可以通过给纯色添加灰色来同时改变颜色的深浅和明暗。 回忆下 `hsl()` 里面的 ‘s’ 和 ‘l’ 分辨代表饱和度和亮度。 饱和度代表灰色的占比,亮度代表白色和黑色的占比。 这在你想获取一个基准色的变种的情景下会十分有用。
|
||||
`hsl()` 使 CSS 更改颜色色调更加方便。 比如,给一个纯色添加白色可以调出更浅的色调;添加黑色可以创造更深的色调。 另外,还可以通过给纯色添加灰色来同时改变颜色的深浅和明暗。 回忆下 `hsl()` 里面的 ‘s’ 和 ‘l’ 分别代表饱和度和亮度。 饱和度代表灰色的占比,亮度代表白色和黑色的占比。 这在你想获取一个基准色的变种的情景下会十分有用。
|
||||
|
||||
# --instructions--
|
||||
|
||||
|
@ -15,25 +15,25 @@ dashedName: divide-the-grid-into-an-area-template
|
||||
grid-template-areas:
|
||||
"header header header"
|
||||
"advert content content"
|
||||
"footer footer footer";
|
||||
"advert footer footer";
|
||||
```
|
||||
|
||||
上面的代码将顶部三个单元格合并成一个名为 `header` 的区域,将底部三个单元格合并为一个名为 `footer` 的区域,并在中间行创建了两个区域:`advert` 和 `content`。 **注意:**在代码中,每个单词代表一个网格单元格,每对引号代表一行。 除了自定义标签,你还能使用句点(`.`)来表示一个空单元格。
|
||||
上面的代码将网格单元格分成四个区域:`header`、`advert`、`content` 和 `footer`。 每个单词代表一个单元格,每对引号代表一行。
|
||||
|
||||
# --instructions--
|
||||
|
||||
请放置区域模板,让名为 `advert` 的区域变成空单元格。
|
||||
更改模板,使 `footer` 区域跨越整个底部行。 定义区域现在不会有任何可视效果。 稍后,你将使用一个区域来查看它的工作方式。
|
||||
|
||||
# --hints--
|
||||
|
||||
class 为 `container` 的元素应具有 `grid-template-areas` 属性,在其属性值中,应使用 `.` 代替 `advert`。
|
||||
class 为 `container` 的元素应具有 `grid-template-areas` 属性,和示例类似,但是 `footer` 区域跨越整个底部行。
|
||||
|
||||
```js
|
||||
assert(
|
||||
__helpers
|
||||
.removeCssComments(code)
|
||||
.match(
|
||||
/.container\s*?{[\s\S]*grid-template-areas\s*?:\s*?"\s*?header\s*?header\s*?header\s*?"\s*?"\s*?.\s*?content\s*?content\s*?"\s*?"\s*?footer\s*?footer\s*?footer\s*?"\s*?;[\s\S]*}/gi
|
||||
/.container\s*?{[\s\S]*grid-template-areas\s*?:\s*?"\s*?header\s*?header\s*?header\s*?"\s*?"\s*?advert\s*?content\s*?content\s*?"\s*?"\s*?footer\s*?footer\s*?footer\s*?"\s*?;[\s\S]*}/gi
|
||||
)
|
||||
);
|
||||
```
|
||||
@ -63,7 +63,7 @@ assert(
|
||||
/* Only change code below this line */
|
||||
"header header header"
|
||||
"advert content content"
|
||||
"footer footer footer";
|
||||
"advert footer footer";
|
||||
/* Only change code above this line */
|
||||
}
|
||||
</style>
|
||||
@ -99,7 +99,7 @@ assert(
|
||||
|
||||
grid-template-areas:
|
||||
"header header header"
|
||||
". content content"
|
||||
"advert content content"
|
||||
"footer footer footer";
|
||||
}
|
||||
</style>
|
||||
|
@ -38,6 +38,12 @@ assert(
|
||||
);
|
||||
```
|
||||
|
||||
`zeroArray(4,3)` 应该返回一个包含 4 行、每行 3 列零的数组。
|
||||
|
||||
```js
|
||||
assert(JSON.stringify(zeroArray(4,3)) == '[[0,0,0],[0,0,0],[0,0,0],[0,0,0]]');
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
## --seed-contents--
|
||||
@ -62,6 +68,7 @@ function zeroArray(m, n) {
|
||||
|
||||
let matrix = zeroArray(3, 2);
|
||||
console.log(matrix);
|
||||
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
@ -86,4 +93,5 @@ function zeroArray(m, n) {
|
||||
|
||||
let matrix = zeroArray(3, 2);
|
||||
console.log(matrix);
|
||||
|
||||
```
|
||||
|
@ -10,7 +10,7 @@ dashedName: match-all-letters-and-numbers
|
||||
|
||||
使用元字符,可以使用 `[a-z]` 搜寻字母表中的所有字母。 这种元字符是很常见的,它有一个缩写,但这个缩写也包含额外的字符。
|
||||
|
||||
JavaScript 中与字母表匹配的最接近的元字符是`\w`。 这个缩写等同于`[A-Za-z0-9_]`。 此字符类匹配上面字母和小写字母以及数字。 注意,这个字符类也包含下划线字符 (`_`)。
|
||||
JavaScript 中与字母表匹配的最接近的元字符是`\w`。 这个缩写等同于`[A-Za-z0-9_]`。 此字符类匹配大写字母和小写字母以及数字。 注意,这个字符类也包含下划线字符 (`_`)。
|
||||
|
||||
```js
|
||||
let longHand = /[A-Za-z0-9_]+/;
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f36e1000cf542c50fe80
|
||||
title: 'Problem 1: Multiples of 3 and 5'
|
||||
title: 'Problema 1: multipli di 3 e 5'
|
||||
challengeType: 5
|
||||
forumTopicId: 301722
|
||||
dashedName: problem-1-multiples-of-3-and-5
|
||||
@ -8,37 +8,37 @@ dashedName: problem-1-multiples-of-3-and-5
|
||||
|
||||
# --description--
|
||||
|
||||
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
|
||||
Se elenchiamo tutti i numeri naturali sotto il 10 che sono multipli di 3 o 5, otteniamo 3, 5, 6 e 9. La somma di questi multipli è 23.
|
||||
|
||||
Find the sum of all the multiples of 3 or 5 below the provided parameter value `number`.
|
||||
Trova la somma di tutti i multipli di 3 e 5 sotto al valore del parametro `number` inserito.
|
||||
|
||||
# --hints--
|
||||
|
||||
`multiplesOf3and5(10)` should return a number.
|
||||
`multiplesOf3and5(10)` dovrebbe restituire un numero.
|
||||
|
||||
```js
|
||||
assert(typeof multiplesOf3and5(10) === 'number');
|
||||
```
|
||||
|
||||
`multiplesOf3and5(49)` should return 543.
|
||||
`multiplesOf3and5(49)` dovrebbe restituire 543.
|
||||
|
||||
```js
|
||||
assert.strictEqual(multiplesOf3and5(49), 543);
|
||||
```
|
||||
|
||||
`multiplesOf3and5(1000)` should return 233168.
|
||||
`multiplesOf3and5(1000)` dovrebbe restituire 233168.
|
||||
|
||||
```js
|
||||
assert.strictEqual(multiplesOf3and5(1000), 233168);
|
||||
```
|
||||
|
||||
`multiplesOf3and5(8456)` should return 16687353.
|
||||
`multiplesOf3and5(8456)` dovrebbe restituire 16687353.
|
||||
|
||||
```js
|
||||
assert.strictEqual(multiplesOf3and5(8456), 16687353);
|
||||
```
|
||||
|
||||
`multiplesOf3and5(19564)` should return 89301183.
|
||||
`multiplesOf3and5(19564)` dovrebbe restituire 89301183.
|
||||
|
||||
```js
|
||||
assert.strictEqual(multiplesOf3and5(19564), 89301183);
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f36e1000cf542c50fe81
|
||||
title: 'Problem 2: Even Fibonacci Numbers'
|
||||
title: 'Problema 2: serie pari di Fibonacci'
|
||||
challengeType: 5
|
||||
forumTopicId: 301838
|
||||
dashedName: problem-2-even-fibonacci-numbers
|
||||
@ -8,63 +8,63 @@ dashedName: problem-2-even-fibonacci-numbers
|
||||
|
||||
# --description--
|
||||
|
||||
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:
|
||||
Ogni nuovo termine della sequenza di Fibonacci è dato dalla somma dei due numeri precedenti. A partire da 1 e 2, i primi 10 termini saranno:
|
||||
|
||||
<div style='text-align: center;'>1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...</div>
|
||||
|
||||
By considering the terms in the Fibonacci sequence whose values do not exceed `n`, find the sum of the even-valued terms.
|
||||
Considerando i termini nella sequenza di Fibonacci i cui valori non superano `n`, trovare la somma dei termini pari.
|
||||
|
||||
# --hints--
|
||||
|
||||
`fiboEvenSum(10)` should return a number.
|
||||
`fiboEvenSum(10)` dovrebbe restituire un numero.
|
||||
|
||||
```js
|
||||
assert(typeof fiboEvenSum(10) === 'number');
|
||||
```
|
||||
|
||||
Your function should return an `even` value.
|
||||
La tua funzione dovrebbe restituire un valore `pari`.
|
||||
|
||||
```js
|
||||
assert.equal(fiboEvenSum(10) % 2 === 0, true);
|
||||
```
|
||||
|
||||
Your function should sum the even-valued Fibonacci numbers: `fiboEvenSum(8)` should return 10.
|
||||
La tua funzione dovrebbe sommare i numeri di Fibonacci a valore pari: `fiboEvenSum(8)` dovrebbe restituire 10.
|
||||
|
||||
```js
|
||||
assert.strictEqual(fiboEvenSum(8), 10);
|
||||
```
|
||||
|
||||
`fiboEvenSum(10)` should return 10.
|
||||
`fiboEvenSum(10)` dovrebbe restituire 10.
|
||||
|
||||
```js
|
||||
assert.strictEqual(fiboEvenSum(10), 10);
|
||||
```
|
||||
|
||||
`fiboEvenSum(34)` should return 44.
|
||||
`fiboEvenSum(34)` dovrebbe restituire 44.
|
||||
|
||||
```js
|
||||
assert.strictEqual(fiboEvenSum(34), 44);
|
||||
```
|
||||
|
||||
`fiboEvenSum(60)` should return 44.
|
||||
`fiboEvenSum(60)` dovrebbe restituire 44.
|
||||
|
||||
```js
|
||||
assert.strictEqual(fiboEvenSum(60), 44);
|
||||
```
|
||||
|
||||
`fiboEvenSum(1000)` should return 798.
|
||||
`fiboEvenSum(1000)` dovrebbe restituire 798.
|
||||
|
||||
```js
|
||||
assert.strictEqual(fiboEvenSum(1000), 798);
|
||||
```
|
||||
|
||||
`fiboEvenSum(100000)` should return 60696.
|
||||
`fiboEvenSum(100000)` dovrebbe restituire 60696.
|
||||
|
||||
```js
|
||||
assert.strictEqual(fiboEvenSum(100000), 60696);
|
||||
```
|
||||
|
||||
`fiboEvenSum(4000000)` should return 4613732.
|
||||
`fiboEvenSum(4000000)` dovrebbe restituire 4613732.
|
||||
|
||||
```js
|
||||
assert.strictEqual(fiboEvenSum(4000000), 4613732);
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5951e88f64ebf159166a1176
|
||||
title: 24 game
|
||||
title: Il gioco del 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.
|
||||
Il [gioco del 24](https://en.wikipedia.org/wiki/24_Game) mette alla prova l'abilità di una persona di fare calcoli a mente.
|
||||
|
||||
The aim of the game is to arrange four numbers in a way that when evaluated, the result is 24
|
||||
L'obbiettivo del gioco è di arrangiare quattro numeri in un modo tale che una volta calcolato il risultato sia 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".
|
||||
Scrivi una funzione che prenda una stringa di quattro cifre come argomento, con ogni cifra tra uno e nove (inclusi) con ripetizioni, e restituisca un'espressione aritmetica che una volta calcolata dia come risultato 24. Se non c'è una soluzione del genere, restituisci "no solution exists".
|
||||
|
||||
**Rules:**
|
||||
**Regole:**
|
||||
<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> Solo le seguenti operazioni/funzioni sono ammesse: moltiplicazione, divisione, addizione, sottrazione. </li>
|
||||
<li> La divisione dovrebbe essere in virgola mobile o aritmetica razionale (frazioni) per preservare i resti. </li>
|
||||
<li> Formare numeri con più di una cifra dalle cifre date non è permesso. (Quindi una risposta di 12+12 quando le cifre date sono 1, 2, 2 e 1 è sbagliata). </li>
|
||||
<li> L'ordine delle cifre nell'input non deve essere conservato. </li>
|
||||
</ul>
|
||||
|
||||
| Example input | Example output |
|
||||
| Esempio di input | Esempio di 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` dovrebbe essere una funzione.
|
||||
|
||||
```js
|
||||
assert(typeof solve24 === 'function');
|
||||
```
|
||||
|
||||
`solve24("4878")` should return `(7-8/8)*4` or `4*(7-8/8)`
|
||||
`solve24("4878")` dovrebbe restituire `(7-8/8)*4` o `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")` dovrebbe restituire un qualsiasi ordine di `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")` dovrebbe restituire `(6*8)/(9-7)` o `(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")` dovrebbe restuire una permutazione di `(1+7)*(1+2)`
|
||||
|
||||
```js
|
||||
assert(include(answers[3], removeParentheses(solve24(testCases[3]))));
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: bd7153d8c242eddfaeb5bd13
|
||||
title: Build a Roguelike Dungeon Crawler Game
|
||||
title: Costruisci un gioco di genere Rogue Dungeon Crawler
|
||||
challengeType: 3
|
||||
forumTopicId: 302355
|
||||
dashedName: build-a-roguelike-dungeon-crawler-game
|
||||
@ -8,31 +8,31 @@ dashedName: build-a-roguelike-dungeon-crawler-game
|
||||
|
||||
# --description--
|
||||
|
||||
**Objective:** Build a [CodePen.io](https://codepen.io) app that is functionally similar to this: <https://codepen.io/freeCodeCamp/full/apLXEJ/>.
|
||||
**Obiettivo:** Costruisci un'app [CodePen.io](https://codepen.io) funzionalmente simile a questa: [https://codepen.io/freeCodeCamp/full/apLXEJ](https://codepen.io/freeCodeCamp/full/apLXEJ/).
|
||||
|
||||
Fulfill the below [user stories](https://en.wikipedia.org/wiki/User_story). Use whichever libraries or APIs you need. Give it your own personal style.
|
||||
Soddisfa le seguenti [user story](https://en.wikipedia.org/wiki/User_story). Utilizza le librerie o le API di cui hai bisogno. Usa il tuo stile personale.
|
||||
|
||||
**User Story:** I have health, a level, and a weapon. I can pick up a better weapon. I can pick up health items.
|
||||
**User Story:** Ho una salute, un livello, e un'arma. Posso raccogliere un'arma migliore. Posso raccogliere oggetti di cura.
|
||||
|
||||
**User Story:** All the items and enemies on the map are arranged at random.
|
||||
**User Story:** Tutti gli oggetti e i nemici sulla mappa sono sistemati casualmente.
|
||||
|
||||
**User Story:** I can move throughout a map, discovering items.
|
||||
**User Story:** Posso muovermi attraverso una mappa, scoprendo oggetti.
|
||||
|
||||
**User Story:** I can move anywhere within the map's boundaries, but I can't move through an enemy until I've beaten it.
|
||||
**User Story:** Posso muovermi ovunque nei confini della mappa, ma non posso muovermi attraverso un nemico prima di averlo sconfitto.
|
||||
|
||||
**User Story:** Much of the map is hidden. When I take a step, all spaces that are within a certain number of spaces from me are revealed.
|
||||
**User Story:** La maggior parte della mappa è nascosta. Quando faccio un passo, tutti gli spazi che sono entro un certo numero di spazi da me sono rivelati.
|
||||
|
||||
**User Story:** When I beat an enemy, the enemy goes away and I get XP, which eventually increases my level.
|
||||
**User Story:** Quando sconfiggo un nemico, il nemico se ne va e io ottengo XP (experience), eventualmente aumentando il mio livello.
|
||||
|
||||
**User Story:** When I fight an enemy, we take turns damaging each other until one of us loses. I do damage based off of my level and my weapon. The enemy does damage based off of its level. Damage is somewhat random within a range.
|
||||
**User Story:** Quando combatto con un nemico, facciamo a turno ad attaccarci finché uno dei due non perde. Faccio danni basati sul mio livello e la mia arma. Il nemico fa dei danni basati sul suo livello. Il danno è casuale all'interno di un intervallo.
|
||||
|
||||
**User Story:** When I find and beat the boss, I win.
|
||||
**User Story:** Quando trovo e sconfiggo il boss, vinco.
|
||||
|
||||
**User Story:** The game should be challenging, but theoretically winnable.
|
||||
**User Story:** Il gioco deve essere sfidante, ma teoricamente battibile.
|
||||
|
||||
When you are finished, include a link to your project on CodePen and click the "I've completed this challenge" button.
|
||||
Quando hai finito, includi un link al tuo progetto su CodePen e clicca sul pulsante "Ho completato questa sfida".
|
||||
|
||||
You can get feedback on your project by sharing it on the [freeCodeCamp forum](https://forum.freecodecamp.org/c/project-feedback/409).
|
||||
Puoi ottenere un feedback sul tuo progetto condividendolo sul forum [freeCodeCamp](https://forum.freecodecamp.org/c/project-feedback/409).
|
||||
|
||||
# --solutions--
|
||||
|
||||
|
@ -75,6 +75,12 @@ assert.sameMembers(
|
||||
);
|
||||
```
|
||||
|
||||
`insertionSort([5, 4, 33, 2, 8])` deve retornar `[2, 4, 5, 8, 33]`.
|
||||
|
||||
```js
|
||||
assert.deepEqual(insertionSort([5, 4, 33, 2, 8]), [2, 4, 5, 8, 33])
|
||||
```
|
||||
|
||||
`insertionSort` não deve usar o método `.sort()` integrado.
|
||||
|
||||
```js
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f3851000cf542c50fe98
|
||||
title: 'Problem 25: 1000-digit Fibonacci number'
|
||||
title: 'Problema 25: Número Fibonacci de 1000 dígitos'
|
||||
challengeType: 5
|
||||
forumTopicId: 301897
|
||||
dashedName: problem-25-1000-digit-fibonacci-number
|
||||
@ -8,45 +8,45 @@ dashedName: problem-25-1000-digit-fibonacci-number
|
||||
|
||||
# --description--
|
||||
|
||||
The Fibonacci sequence is defined by the recurrence relation:
|
||||
A sequência de Fibonacci é definida pela relação de recorrência:
|
||||
|
||||
<div style='padding-left: 4em;'>F<sub>n</sub> = F<sub>n−1</sub> + F<sub>n−2</sub>, where F<sub>1</sub> = 1 and F<sub>2</sub> = 1.</div>
|
||||
|
||||
Hence the first 12 terms will be:
|
||||
Portanto, os primeiros 12 termos serão:
|
||||
|
||||
<div style='padding-left: 4em; display: inline-grid; grid-template-rows: auto; row-gap: 7px;'><div>F<sub>1</sub> = 1</div><div>F<sub>2</sub> = 1</div><div>F<sub>3</sub> = 2</div><div>F<sub>4</sub> = 3</div><div>F<sub>5</sub> = 5</div><div>F<sub>6</sub> = 8</div><div>F<sub>7</sub> = 13</div><div>F<sub>8</sub> = 21</div><div>F<sub>9</sub> = 34</div><div>F<sub>10</sub> = 55</div><div>F<sub>11</sub> = 89</div><div>F<sub>12</sub> = 144</div></div>
|
||||
|
||||
The 12th term, F<sub>12</sub>, is the first term to contain three digits.
|
||||
O 12º termo, F<sub>12</sub>, é o primeiro termo a conter três dígitos.
|
||||
|
||||
What is the index of the first term in the Fibonacci sequence to contain `n` digits?
|
||||
Qual é o índice do primeiro termo na sequência de Fibonacci a conter `n` dígitos?
|
||||
|
||||
# --hints--
|
||||
|
||||
`digitFibonacci(5)` should return a number.
|
||||
`digitFibonacci(5)` deve retornar um número.
|
||||
|
||||
```js
|
||||
assert(typeof digitFibonacci(5) === 'number');
|
||||
```
|
||||
|
||||
`digitFibonacci(5)` should return 21.
|
||||
`digitFibonacci(5)` deve retornar 21.
|
||||
|
||||
```js
|
||||
assert.strictEqual(digitFibonacci(5), 21);
|
||||
```
|
||||
|
||||
`digitFibonacci(10)` should return 45.
|
||||
`digitFibonacci(10)` deve retornar 45.
|
||||
|
||||
```js
|
||||
assert.strictEqual(digitFibonacci(10), 45);
|
||||
```
|
||||
|
||||
`digitFibonacci(15)` should return 69.
|
||||
`digitFibonacci(15)` deve retornar 69.
|
||||
|
||||
```js
|
||||
assert.strictEqual(digitFibonacci(15), 69);
|
||||
```
|
||||
|
||||
`digitFibonacci(20)` should return 93.
|
||||
`digitFibonacci(20)` deve retornar 93.
|
||||
|
||||
```js
|
||||
assert.strictEqual(digitFibonacci(20), 93);
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f3881000cf542c50fe9b
|
||||
title: 'Problem 28: Number spiral diagonals'
|
||||
title: 'Problema 28: soma dos números nas diagonais'
|
||||
challengeType: 5
|
||||
forumTopicId: 301930
|
||||
dashedName: problem-28-number-spiral-diagonals
|
||||
@ -8,7 +8,7 @@ dashedName: problem-28-number-spiral-diagonals
|
||||
|
||||
# --description--
|
||||
|
||||
Starting with the number 1 and moving to the right in a clockwise direction a 5 by 5 spiral is formed as follows:
|
||||
Começando com o número 1 e movendo-se para a direita no sentido horário, uma espiral de 5x5 é formada:
|
||||
|
||||
<div style='padding-left: 4em;'>
|
||||
<div style='color: red; display: inline;'>21</div> 22 23 24 <div style='color: red; display: inline;'>25</div><br>
|
||||
@ -18,37 +18,37 @@ Starting with the number 1 and moving to the right in a clockwise direction a 5
|
||||
<div style='color: red; display: inline;'>17</div> 16 15 14 <div style='color: red; display: inline;'>13</div><br>
|
||||
</div>
|
||||
|
||||
It can be verified that the sum of the numbers on the diagonals is 101.
|
||||
É possível verificar que a soma dos números nas diagonais é 101.
|
||||
|
||||
What is the sum of the numbers on the diagonals in an `n` by `n` spiral formed in the same way?
|
||||
Qual é a soma dos números nas diagonais em uma espiral `n` x `n` formada da mesma forma?
|
||||
|
||||
# --hints--
|
||||
|
||||
`spiralDiagonals(101)` should return a number.
|
||||
`spiralDiagonals(101)` deve retornar um número.
|
||||
|
||||
```js
|
||||
assert(typeof spiralDiagonals(101) === 'number');
|
||||
```
|
||||
|
||||
`spiralDiagonals(101)` should return 692101.
|
||||
`spiralDiagonals(101)` deve retornar 692101.
|
||||
|
||||
```js
|
||||
assert(spiralDiagonals(101) == 692101);
|
||||
```
|
||||
|
||||
`spiralDiagonals(303)` should return 18591725.
|
||||
`spiralDiagonals(303)` deve retornar 18591725.
|
||||
|
||||
```js
|
||||
assert(spiralDiagonals(303) == 18591725);
|
||||
```
|
||||
|
||||
`spiralDiagonals(505)` should return 85986601.
|
||||
`spiralDiagonals(505)` deve retornar 85986601.
|
||||
|
||||
```js
|
||||
assert(spiralDiagonals(505) == 85986601);
|
||||
```
|
||||
|
||||
`spiralDiagonals(1001)` should return 669171001.
|
||||
`spiralDiagonals(1001)` deve retornar 669171001.
|
||||
|
||||
```js
|
||||
assert(spiralDiagonals(1001) == 669171001);
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f3891000cf542c50fe9c
|
||||
title: 'Problem 29: Distinct powers'
|
||||
title: 'Problema 29: Potências distintas'
|
||||
challengeType: 5
|
||||
forumTopicId: 301941
|
||||
dashedName: problem-29-distinct-powers
|
||||
@ -8,7 +8,7 @@ dashedName: problem-29-distinct-powers
|
||||
|
||||
# --description--
|
||||
|
||||
Consider all integer combinations of ab for 2 ≤ a ≤ 5 and 2 ≤ b ≤ 5:
|
||||
Considere todas as combinações de ab onde 2 ≤ a ≤ 5 e 2 ≤ b ≤ 5:
|
||||
|
||||
<div style='padding-left: 4em;'>
|
||||
2<sup>2</sup>=4, 2<sup>3</sup>=8, 2<sup>4</sup>=16, 2<sup>5</sup>=32 <br>
|
||||
@ -17,41 +17,41 @@ Consider all integer combinations of ab for 2 ≤ a ≤ 5 and 2 ≤ b ≤ 5:
|
||||
5<sup>2</sup>=25, 5<sup>3</sup>=125, 5<sup>4</sup>=625, 5<sup>5</sup>=3125 <br>
|
||||
</div>
|
||||
|
||||
If they are then placed in numerical order, with any repeats removed, we get the following sequence of 15 distinct terms:
|
||||
Se eles forem colocados em ordem numérica, com quaisquer repetições removidas, obtemos a seguinte sequência de 15 termos distintos:
|
||||
|
||||
<div style='padding-left: 4em;'>
|
||||
4, 8, 9, 16, 25, 27, 32, 64, 81, 125, 243, 256, 625, 1024, 3125
|
||||
</div>
|
||||
|
||||
How many distinct terms are in the sequence generated by `ab` for 2 ≤ `a` ≤ `n` and 2 ≤ `b` ≤ `n`?
|
||||
Quantos termos distintos existem na sequência `ab` onde 2 ≤ `a` ≤ `n` and 2 ≤ `b` ≤ `n`?
|
||||
|
||||
# --hints--
|
||||
|
||||
`distinctPowers(15)` should return a number.
|
||||
`distinctPowers(15)` deve retornar um número.
|
||||
|
||||
```js
|
||||
assert(typeof distinctPowers(15) === 'number');
|
||||
```
|
||||
|
||||
`distinctPowers(15)` should return 177.
|
||||
`distinctPowers(15)` deve retornar 177.
|
||||
|
||||
```js
|
||||
assert.strictEqual(distinctPowers(15), 177);
|
||||
```
|
||||
|
||||
`distinctPowers(20)` should return 324.
|
||||
`distinctPowers(20)` deve retornar 324.
|
||||
|
||||
```js
|
||||
assert.strictEqual(distinctPowers(20), 324);
|
||||
```
|
||||
|
||||
`distinctPowers(25)` should return 519.
|
||||
`distinctPowers(25)` deve retornar 519.
|
||||
|
||||
```js
|
||||
assert.strictEqual(distinctPowers(25), 519);
|
||||
```
|
||||
|
||||
`distinctPowers(30)` should return 755.
|
||||
`distinctPowers(30)` deve retornar 755.
|
||||
|
||||
```js
|
||||
assert.strictEqual(distinctPowers(30), 755);
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f38a1000cf542c50fe9d
|
||||
title: 'Problem 30: Digit n powers'
|
||||
title: 'Problema 30: Potências do número n'
|
||||
challengeType: 5
|
||||
forumTopicId: 301953
|
||||
dashedName: problem-30-digit-n-powers
|
||||
@ -8,7 +8,7 @@ dashedName: problem-30-digit-n-powers
|
||||
|
||||
# --description--
|
||||
|
||||
Surprisingly there are only three numbers that can be written as the sum of fourth powers of their digits:
|
||||
Surpreendentemente, há apenas três números que são iguais à soma de seus dígitos elevados a 4:
|
||||
|
||||
<div style='margin-left: 4em;'>
|
||||
1634 = 1<sup>4</sup> + 6<sup>4</sup> + 3<sup>4</sup> + 4<sup>4</sup><br>
|
||||
@ -16,39 +16,39 @@ Surprisingly there are only three numbers that can be written as the sum of four
|
||||
9474 = 9<sup>4</sup> + 4<sup>4</sup> + 7<sup>4</sup> + 4<sup>4</sup><br>
|
||||
</div>
|
||||
|
||||
As 1 = 1<sup>4</sup> is not a sum it is not included.
|
||||
Como 1 = 1<sup>4</sup> não é uma soma, ele não deve ser incluído.
|
||||
|
||||
The sum of these numbers is 1634 + 8208 + 9474 = 19316.
|
||||
A soma destes números é 1634 + 8208 + 9474 = 19316.
|
||||
|
||||
Find the sum of all the numbers that can be written as the sum of `n` powers of their digits.
|
||||
Encontre a soma de todos os números que são iguais à soma de seus dígitos elevados a `n`.
|
||||
|
||||
# --hints--
|
||||
|
||||
`digitnPowers(2)` should return a number.
|
||||
`digitnPowers(2)` deve retornar um número.
|
||||
|
||||
```js
|
||||
assert(typeof digitnPowers(2) === 'number');
|
||||
```
|
||||
|
||||
`digitnPowers(2)` should return 0.
|
||||
`digitnPowers(2)` deve retornar 0.
|
||||
|
||||
```js
|
||||
assert(digitnPowers(2) == 0);
|
||||
```
|
||||
|
||||
`digitnPowers(3)` should return 1301.
|
||||
`digitnPowers(3)` deve retornar 1301.
|
||||
|
||||
```js
|
||||
assert(digitnPowers(3) == 1301);
|
||||
```
|
||||
|
||||
`digitnPowers(4)` should return 19316.
|
||||
`digitnPowers(4)` deve retornar 19316.
|
||||
|
||||
```js
|
||||
assert(digitnPowers(4) == 19316);
|
||||
```
|
||||
|
||||
`digitnPowers(5)` should return 443839.
|
||||
`digitnPowers(5)` deve retornar 443839.
|
||||
|
||||
```js
|
||||
assert(digitnPowers(5) == 443839);
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f38b1000cf542c50fe9e
|
||||
title: 'Problem 31: Coin sums'
|
||||
title: 'Problema 31: Soma de moedas'
|
||||
challengeType: 5
|
||||
forumTopicId: 301965
|
||||
dashedName: problem-31-coin-sums
|
||||
@ -8,43 +8,43 @@ dashedName: problem-31-coin-sums
|
||||
|
||||
# --description--
|
||||
|
||||
In England the currency is made up of pound, £, and pence, p, and there are eight coins in general circulation:
|
||||
Na Inglaterra, a moeda é composta pela libra (£) e pelos pence. No geral, há oito valores em circulação:
|
||||
|
||||
<div style='margin-left: 4em;'>1p, 2p, 5p, 10p, 20p, 50p, £1 (100p) and £2 (200p).</div>
|
||||
<div style='margin-left: 4em;'>1p, 2p, 5p, 10p, 20p, 50p, £1 (100p) e £2 (200p).</div>
|
||||
|
||||
It is possible to make £2 in the following way:
|
||||
É possível fazer £2 da seguinte maneira:
|
||||
|
||||
<div style='margin-left: 4em;'>1×£1 + 1×50p + 2×20p + 1×5p + 1×2p + 3×1p</div>
|
||||
|
||||
How many different ways can `n` pence be made using any number of coins?
|
||||
De quantas maneiras `n` pence podem ser feitos utilizando os valores mencionados?
|
||||
|
||||
# --hints--
|
||||
|
||||
`coinSums(50)` should return a number.
|
||||
`coinSums(50)` deve retornar um número.
|
||||
|
||||
```js
|
||||
assert(typeof coinSums(50) === 'number');
|
||||
```
|
||||
|
||||
`coinSums(50)` should return 451.
|
||||
`coinSums(50)` deve retornar 451.
|
||||
|
||||
```js
|
||||
assert(coinSums(50) == 451);
|
||||
```
|
||||
|
||||
`coinSums(100)` should return 4563.
|
||||
`coinSums(100)` deve retornar 4563.
|
||||
|
||||
```js
|
||||
assert(coinSums(100) == 4563);
|
||||
```
|
||||
|
||||
`coinSums(150)` should return 21873.
|
||||
`coinSums(150)` deve retornar 21873.
|
||||
|
||||
```js
|
||||
assert(coinSums(150) == 21873);
|
||||
```
|
||||
|
||||
`coinSums(200)` should return 73682.
|
||||
`coinSums(200)` deve retornar 73682.
|
||||
|
||||
```js
|
||||
assert(coinSums(200) == 73682);
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f38c1000cf542c50fe9f
|
||||
title: 'Problem 32: Pandigital products'
|
||||
title: 'Problema 32: Produtos pandigitais'
|
||||
challengeType: 5
|
||||
forumTopicId: 301976
|
||||
dashedName: problem-32-pandigital-products
|
||||
@ -8,47 +8,47 @@ dashedName: problem-32-pandigital-products
|
||||
|
||||
# --description--
|
||||
|
||||
We shall say that an `n`-digit number is pandigital if it makes use of all the digits 1 to `n` exactly once; for example, the 5-digit number, 15234, is 1 through 5 pandigital.
|
||||
Dizemos que um número de `n` algarismos é pandigital se ele usar todos os dígitos de 1 a `n` uma única vez. Por exemplo, o número 15234 é pandigital pois possui 5 algarismos e utiliza todos os algarismos entre 1 e 5.
|
||||
|
||||
The product 7254 is unusual, as the identity, 39 × 186 = 7254, containing multiplicand, multiplier, and product is 1 through 9 pandigital.
|
||||
Considere o produto 39 x 186 = 7254. O multiplicando (39), multiplicador (186) e o produto (7254) possuem, no total, nove algarismos e nenhum deles se repetem.
|
||||
|
||||
Find the sum of all products whose multiplicand/multiplier/product identity can be written as a 1 through `n` pandigital.
|
||||
Calcule a soma de todos os produtos cujo multiplicando, multiplicador e produto formam um número pandigital (entre 1 e `n`).
|
||||
|
||||
**Hint:** Some products can be obtained in more than one way so be sure to only include it once in your sum.
|
||||
**Dica:** alguns produtos podem ser obtidos de mais de uma forma, portanto, certifique-se de incluí-lo apenas uma vez na sua soma.
|
||||
|
||||
# --hints--
|
||||
|
||||
`pandigitalProducts(4)` should return a number.
|
||||
`pandigitalProducts(4)` deve retornar um número.
|
||||
|
||||
```js
|
||||
assert(typeof pandigitalProducts(4) === 'number');
|
||||
```
|
||||
|
||||
`pandigitalProducts(4)` should return `12`.
|
||||
`pandigitalProducts(4)` deve retornar `12`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(pandigitalProducts(4), 12);
|
||||
```
|
||||
|
||||
`pandigitalProducts(6)` should return `162`.
|
||||
`pandigitalProducts(6)` deve retornar `162`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(pandigitalProducts(6), 162);
|
||||
```
|
||||
|
||||
`pandigitalProducts(7)` should return `0`.
|
||||
`pandigitalProducts(7)` deve retornar `0`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(pandigitalProducts(7), 0);
|
||||
```
|
||||
|
||||
`pandigitalProducts(8)` should return `13458`.
|
||||
`pandigitalProducts(8)` deve retornar `13458`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(pandigitalProducts(8), 13458);
|
||||
```
|
||||
|
||||
`pandigitalProducts(9)` should return `45228`.
|
||||
`pandigitalProducts(9)` deve retornar `45228`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(pandigitalProducts(9), 45228);
|
||||
|
Reference in New Issue
Block a user