2020-10-06 23:10:08 +05:30

2.3 KiB
Raw Blame History

id, challengeType, videoUrl, localeTitle
id challengeType videoUrl localeTitle
5a23c84252665b21eecc7eb0 5 我在E之前除了C之后

Description

短语“我在E之前除了C之后”是一个广为人知的助记符它应该有助于拼写英语单词。使用提供的单词检查短语的两个子句是否合理
  1. “我在E之前没有前面的C”。
  2. “在我之前的C之前是C”。
如果两个子短语都是合理的则原始短语可以说是合理的。编写一个接受单词的函数并检查单词是否遵循此规则。如果该函数遵循规则则该函数应返回true否则返回false。

Instructions

Tests

tests:
  - text: <code>IBeforeExceptC</code>应该是一个函数。
    testString: assert(typeof IBeforeExceptC=='function');
  - text: <code>IBeforeExceptC("receive")</code>应该返回一个布尔值。
    testString: assert(typeof IBeforeExceptC("receive")=='boolean');
  - text: <code>IBeforeExceptC("receive")</code>应该返回<code>true</code> 。
    testString: assert.equal(IBeforeExceptC("receive"),true);
  - text: <code>IBeforeExceptC("science")</code>应该返回<code>false</code> 。
    testString: assert.equal(IBeforeExceptC("science"),false);
  - text: <code>IBeforeExceptC("imperceivable")</code>应该返回<code>true</code> 。
    testString: assert.equal(IBeforeExceptC("imperceivable"),true);
  - text: <code>IBeforeExceptC("inconceivable")</code>应该返回<code>true</code> 。
    testString: assert.equal(IBeforeExceptC("inconceivable"),true);
  - text: <code>IBeforeExceptC("insufficient")</code>应返回<code>false</code> 。
    testString: assert.equal(IBeforeExceptC("insufficient"),false);
  - text: <code>IBeforeExceptC("omniscient")</code>应该返回<code>false</code> 。
    testString: assert.equal(IBeforeExceptC("omniscient"),false);

Challenge Seed

function IBeforeExceptC (word) {
  // Good luck!
}

Solution

// solution required

/section>