75 lines
2.7 KiB
Markdown
75 lines
2.7 KiB
Markdown
---
|
||
title: ABC Problem
|
||
id: 594810f028c0303b75339acc
|
||
challengeType: 5
|
||
videoUrl: ''
|
||
localeTitle: ABC问题
|
||
---
|
||
|
||
## Description
|
||
<section id="description"><p>您将获得ABC块的集合(例如,童年字母块)。每个街区有20个街区,两个字母。块的所有侧面都保证有完整的字母表。块的样本集合: </p><p> (BO) </p><p> (XK) </p><p> (DQ) </p><p> (CP) </p><p> (NA) </p><p> (GT) </p><p> (回覆) </p><p> (TG) </p><p> (QD) </p><p> (FS) </p><p> (JW) </p><p> (HU) </p><p> (VI) </p><p> (一个) </p><p> (OB) </p><p> (ER) </p><p> (FS) </p><p> (LY) </p><p> (PC) </p><p> (ZM) </p><p>要记住一些规则: </p>一旦使用了块上的字母,就不能再使用该块。该函数应该不区分大小写。 <p>实现一个带字符串(单词)的函数,并确定该单词是否可以与给定的块集合拼写。 </p></section>
|
||
|
||
## Instructions
|
||
<section id="instructions">
|
||
</section>
|
||
|
||
## Tests
|
||
<section id='tests'>
|
||
|
||
```yml
|
||
tests:
|
||
- text: <code>canMakeWord</code>是一个功能。
|
||
testString: 'assert(typeof canMakeWord === "function", "<code>canMakeWord</code> is a function.");'
|
||
- text: <code>canMakeWord</code>应该返回一个布尔值。
|
||
testString: 'assert(typeof canMakeWord("hi") === "boolean", "<code>canMakeWord</code> should return a boolean.");'
|
||
- text: <code>canMakeWord("bark")</code>应该返回true。
|
||
testString: 'assert(canMakeWord(words[0]), "<code>canMakeWord("bark")</code> should return true.");'
|
||
- text: <code>canMakeWord("BooK")</code>应该返回false。
|
||
testString: 'assert(!canMakeWord(words[1]), "<code>canMakeWord("BooK")</code> should return false.");'
|
||
- text: <code>canMakeWord("TReAT")</code>应该返回true。
|
||
testString: 'assert(canMakeWord(words[2]), "<code>canMakeWord("TReAT")</code> should return true.");'
|
||
- text: <code>canMakeWord("COMMON")</code>应返回false。
|
||
testString: 'assert(!canMakeWord(words[3]), "<code>canMakeWord("COMMON")</code> should return false.");'
|
||
- text: <code>canMakeWord("squAD")</code>应该返回true。
|
||
testString: 'assert(canMakeWord(words[4]), "<code>canMakeWord("squAD")</code> should return true.");'
|
||
- text: <code>canMakeWord("conFUSE")</code>应该返回true。
|
||
testString: 'assert(canMakeWord(words[5]), "<code>canMakeWord("conFUSE")</code> should return true.");'
|
||
|
||
```
|
||
|
||
</section>
|
||
|
||
## Challenge Seed
|
||
<section id='challengeSeed'>
|
||
|
||
<div id='js-seed'>
|
||
|
||
```js
|
||
function canMakeWord (word) {
|
||
// Good luck!
|
||
}
|
||
|
||
```
|
||
|
||
</div>
|
||
|
||
|
||
### After Test
|
||
<div id='js-teardown'>
|
||
|
||
```js
|
||
console.info('after the test');
|
||
```
|
||
|
||
</div>
|
||
|
||
</section>
|
||
|
||
## Solution
|
||
<section id='solution'>
|
||
|
||
```js
|
||
// solution required
|
||
```
|
||
</section>
|