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

2.0 KiB

id, title, challengeType, forumTopicId, dashedName
id title challengeType forumTopicId dashedName
5a23c84252665b21eecc7eb0 I before E except after C 5 302288 i-before-e-except-after-c

--description--

The phrase "I before E, except after C" is a widely known mnemonic which is supposed to help when spelling English words.

Using the words provided, check if the two sub-clauses of the phrase are plausible individually:

  1. "I before E when not preceded by C".
  2. "E before I when preceded by C".

If both sub-phrases are plausible then the original phrase can be said to be plausible.

--instructions--

Write a function that accepts a word and check if the word follows this rule. The function should return true if the word follows the rule and false if it does not.

--hints--

IBeforeExceptC should be a function.

assert(typeof IBeforeExceptC == 'function');

IBeforeExceptC("receive") should return a boolean.

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

IBeforeExceptC("receive") should return true.

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

IBeforeExceptC("science") should return false.

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

IBeforeExceptC("imperceivable") should return true.

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

IBeforeExceptC("inconceivable") should return true.

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

IBeforeExceptC("insufficient") should return false.

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

IBeforeExceptC("omniscient") should return 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;
}