Oliver Eyton-Williams ee1e8abd87
feat(curriculum): restore seed + solution to Chinese (#40683)
* feat(tools): add seed/solution restore script

* chore(curriculum): remove empty sections' markers

* chore(curriculum): add seed + solution to Chinese

* chore: remove old formatter

* fix: update getChallenges

parse translated challenges separately, without reference to the source

* chore(curriculum): add dashedName to English

* chore(curriculum): add dashedName to Chinese

* refactor: remove unused challenge property 'name'

* fix: relax dashedName requirement

* fix: stray tag

Remove stray `pre` tag from challenge file.

Signed-off-by: nhcarrigan <nhcarrigan@gmail.com>

Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
2021-01-12 19:31:00 -07:00

1.9 KiB
Raw Blame History

id, title, challengeType, videoUrl, dashedName
id title challengeType videoUrl dashedName
5a23c84252665b21eecc7eb0 我在E之前除了C之后 5 i-before-e-except-after-c

--description--

短语“我在E之前除了C之后”是一个广为人知的助记符,它应该有助于拼写英语单词。使用提供的单词,检查短语的两个子句是否合理:

  1. “我在E之前没有前面的C”。
  2. “在我之前的C之前是C”。

如果两个子短语都是合理的则原始短语可以说是合理的。编写一个接受单词的函数并检查单词是否遵循此规则。如果该函数遵循规则则该函数应返回true否则返回false。

--hints--

IBeforeExceptC应该是一个函数。

assert(typeof IBeforeExceptC == 'function');

IBeforeExceptC("receive")应该返回一个布尔值。

assert(typeof IBeforeExceptC('receive') == 'boolean');

IBeforeExceptC("receive")应该返回true

assert.equal(IBeforeExceptC('receive'), true);

IBeforeExceptC("science")应该返回false

assert.equal(IBeforeExceptC('science'), false);

IBeforeExceptC("imperceivable")应该返回true

assert.equal(IBeforeExceptC('imperceivable'), true);

IBeforeExceptC("inconceivable")应该返回true

assert.equal(IBeforeExceptC('inconceivable'), true);

IBeforeExceptC("insufficient")应返回false

assert.equal(IBeforeExceptC('insufficient'), false);

IBeforeExceptC("omniscient")应该返回false

assert.equal(IBeforeExceptC('omniscient'), false);

--seed--

--seed-contents--

function IBeforeExceptC(word) {

}

--solutions--

function IBeforeExceptC(word)
{
    if(word.indexOf("c")==-1 && word.indexOf("ie")!=-1)
        return true;
    else if(word.indexOf("cei")!=-1)
        return true;
    return false;
}