chore(i8n,learn): processed translations
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
15047f2d90
commit
e5c44a3ae5
@ -1,24 +1,32 @@
|
||||
---
|
||||
id: 5a23c84252665b21eecc7e78
|
||||
title: 一般的FizzBuzz
|
||||
title: General FizzBuzz
|
||||
challengeType: 5
|
||||
videoUrl: ''
|
||||
forumTopicId: 302273
|
||||
dashedName: general-fizzbuzz
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
编写[FizzBuzz](http://rosettacode.org/wiki/FizzBuzz)的通用版本,适用于任何因子列表及其单词。这基本上是一种“fizzbuzz”实现,其中游戏规则被提供给用户。创建一个实现此功能的函数。该函数应该有两个参数。第一个是带有FizzBuzz规则的数组。例如: `[ [3,"Fizz"] , [5,"Buzz"] ]` 。此indcates该`Fizz` ,如果数量是3的倍数,并应被打印`Buzz`如果是5的倍数。如果它是两则字符串应该在阵列中指定的顺序被连结的倍数。在这种情况下,如果数字是3和5的倍数,则为`FizzBuzz` 。第二个参数是函数应返回如上所述的字符串的数字。
|
||||
Write a generalized version of [FizzBuzz](https://rosettacode.org/wiki/FizzBuzz) that works for any list of factors, along with their words.
|
||||
|
||||
This is basically a "fizzbuzz" implementation where the rules of the game are supplied to the user. Create a function to implement this. The function should take two parameters.
|
||||
|
||||
The first will be an array with the FizzBuzz rules. For example: `[ [3, "Fizz"] , [5, "Buzz"] ]`.
|
||||
|
||||
This indicates that `Fizz` should be printed if the number is a multiple of 3 and `Buzz` if it is a multiple of 5. If it is a multiple of both then the strings should be concatenated in the order specified in the array. In this case, `FizzBuzz` if the number is a multiple of 3 and 5.
|
||||
|
||||
The second parameter is the number for which the function should return a string as stated above.
|
||||
|
||||
# --hints--
|
||||
|
||||
`genFizzBuzz`应该是一个功能。
|
||||
`genFizzBuzz` should be a function.
|
||||
|
||||
```js
|
||||
assert(typeof genFizzBuzz == 'function');
|
||||
```
|
||||
|
||||
`genFizzBuzz("+JSON.stringify(tests[0][0])+","+tests[0][1]+")`应该返回一个类型。
|
||||
`genFizzBuzz([[3, "Fizz"],[5, "Buzz"]], 6)` should return a string.
|
||||
|
||||
```js
|
||||
assert(
|
||||
@ -32,7 +40,7 @@ assert(
|
||||
);
|
||||
```
|
||||
|
||||
`genFizzBuzz("+JSON.stringify(tests[0][0])+","+tests[0][1]+")`应返回`""+results[0]+""` 。
|
||||
`genFizzBuzz([[3, "Fizz"],[5, "Buzz"]], 6)` should return `"Fizz"`.
|
||||
|
||||
```js
|
||||
assert.equal(
|
||||
@ -47,7 +55,7 @@ assert.equal(
|
||||
);
|
||||
```
|
||||
|
||||
`genFizzBuzz("+JSON.stringify(tests[1][0])+","+tests[1][1]+")`应返回`""+results[1]+""` 。
|
||||
`genFizzBuzz([[3, "Fizz"],[5, "Buzz"]], 10)` should return `"Buzz"`.
|
||||
|
||||
```js
|
||||
assert.equal(
|
||||
@ -62,7 +70,7 @@ assert.equal(
|
||||
);
|
||||
```
|
||||
|
||||
`genFizzBuzz("+JSON.stringify(tests[2][0])+","+tests[2][1]+")`应返回`""+results[2]+""` 。
|
||||
`genFizzBuzz([[3, "Buzz"],[5, "Fizz"]], 12)` should return `"Buzz"`.
|
||||
|
||||
```js
|
||||
assert.equal(
|
||||
@ -77,7 +85,7 @@ assert.equal(
|
||||
);
|
||||
```
|
||||
|
||||
`genFizzBuzz("+JSON.stringify(tests[3][0])+","+tests[3][1]+")`应返回`""+results[3]+""` 。
|
||||
`genFizzBuzz([[3, "Buzz"],[5, "Fizz"]], 13)` should return `"13"`.
|
||||
|
||||
```js
|
||||
assert.equal(
|
||||
@ -92,7 +100,7 @@ assert.equal(
|
||||
);
|
||||
```
|
||||
|
||||
`genFizzBuzz("+JSON.stringify(tests[4][0])+","+tests[4][1]+")`应该返回`""+results[4]+""` 。
|
||||
`genFizzBuzz([[3, "Buzz"],[5, "Fizz"]], 15)` should return `"BuzzFizz"`.
|
||||
|
||||
```js
|
||||
assert.equal(
|
||||
@ -107,7 +115,7 @@ assert.equal(
|
||||
);
|
||||
```
|
||||
|
||||
`genFizzBuzz("+JSON.stringify(tests[5][0])+","+tests[5][1]+")`应返回`""+results[5]+""` 。
|
||||
`genFizzBuzz([[3, "Fizz"],[5, "Buzz"]], 15)` should return `"FizzBuzz"`.
|
||||
|
||||
```js
|
||||
assert.equal(
|
||||
@ -122,7 +130,7 @@ assert.equal(
|
||||
);
|
||||
```
|
||||
|
||||
`genFizzBuzz("+JSON.stringify(tests[6][0])+","+tests[6][1]+")`应该返回`""+results[6]+""` 。
|
||||
`genFizzBuzz([[3, "Fizz"],[5, "Buzz"],[7, "Baxx"]], 105)` should return `"FizzBuzzBaxx"`.
|
||||
|
||||
```js
|
||||
assert.equal(
|
||||
|
Reference in New Issue
Block a user