diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/applied-visual-design/add-a-box-shadow-to-a-card-like-element.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/applied-visual-design/add-a-box-shadow-to-a-card-like-element.md index 6f849f04f3..024c531e35 100644 --- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/applied-visual-design/add-a-box-shadow-to-a-card-like-element.md +++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/applied-visual-design/add-a-box-shadow-to-a-card-like-element.md @@ -11,13 +11,13 @@ dashedName: add-a-box-shadow-to-a-card-like-element `box-shadow` 屬性用來給元素添加陰影,該屬性值是由逗號分隔的一個或多個陰影列表。 -`box-shadow` 屬性的陰影依次由下面這些值描述: +`box-shadow` 屬性按順序採用以下值: diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/applied-visual-design/adjust-the-hue-of-a-color.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/applied-visual-design/adjust-the-hue-of-a-color.md index 3fcb82f6ed..e1f1a30130 100644 --- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/applied-visual-design/adjust-the-hue-of-a-color.md +++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/applied-visual-design/adjust-the-hue-of-a-color.md @@ -9,7 +9,7 @@ dashedName: adjust-the-hue-of-a-color # --description-- -顏色具有多種特性,包括色相、飽和度和亮度。 CSS3 引入了 `hsl()` 做爲顏色的描述方式。 +顏色具有多種特性,包括色相、飽和度和亮度。 CSS3 引入了`hsl()`函數,作爲直接說明這些特徵來挑選顏色的替代方法。 **色相** 是色彩的基本屬性,就是平常所說的顏色名稱,如紅色、黃色等。 以顏色光譜爲例,光譜左邊從紅色開始,移動到中間的綠色,一直到右邊的藍色,色相值就是沿着這條線的取值。 在 `hsl()` 裏面,色相用色環來代替光譜,色相值就是色環裏面的顏色對應的從 0 到 360 度的角度值。 @@ -27,19 +27,19 @@ dashedName: adjust-the-hue-of-a-color # --hints-- -應使用 `hsl()` 屬性來設置顏色爲 `green`。 +應使用 `hsl()` 函數來設置顏色爲 `green`。 ```js assert(code.match(/\.green\s*?{\s*?background-color\s*:\s*?hsl/gi)); ``` -應使用 `hsl()` 屬性來設置顏色爲 `cyan`。 +應使用 `hsl()` 函數來設置顏色爲 `cyan`。 ```js assert(code.match(/\.cyan\s*?{\s*?background-color\s*:\s*?hsl/gi)); ``` -應使用 `hsl()` 屬性來設置顏色爲 `blue`。 +應使用 `hsl()` 函數來設置顏色爲 `blue`。 ```js assert(code.match(/\.blue\s*?{\s*?background-color\s*:\s*?hsl/gi)); diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/applied-visual-design/create-a-graphic-using-css.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/applied-visual-design/create-a-graphic-using-css.md index b2a1da0c88..bf4b287001 100644 --- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/applied-visual-design/create-a-graphic-using-css.md +++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/applied-visual-design/create-a-graphic-using-css.md @@ -15,11 +15,11 @@ dashedName: create-a-graphic-using-css 爲了創建一個圓形的對象,`border-radius` 應該被設置成 50%。 -你應該還記得之前關卡的 `box-shadow` 屬性以及它的依次取值 `offset-x`、`offset-y`、`blur-radius`、`spread-radius` 和顏色值。 其中 `blur-radius` 和 `spread-radius` 是可選的。 +你應該還記得之前關卡的 `box-shadow` 屬性以及它的依次取值 `offset-x`、`offset-y`、`blur-radius`、`spread-radius` 和 `color` 值。 其中 `blur-radius` 和 `spread-radius` 是可選的。 # --instructions-- -把編輯器裏的正方形元素變成新月形狀。 首先,把 `background-color` 改爲 `transparent`,接着把 `border-radius` 屬性設置成 50%,以創建一個圓形。 最後,更改 `box-shadow` 屬性,使其 `offset-x` 爲 25px,`offset-y` 爲 10px,`blur-radius` 爲 0,`spread-radius` 爲 0,顏色爲 `blue`。 +把編輯器裏的正方形元素變成新月形狀。 首先,把 `background-color` 改爲 `transparent`,接着把 `border-radius` 屬性設置成 50%,以創建一個圓形。 最後,更改 `box-shadow` 屬性,使其 `offset-x` 爲 25px,`offset-y` 爲 10px,`blur-radius` 爲 0,`spread-radius` 爲 0,`color` 爲 `blue`。 # --hints-- @@ -35,7 +35,7 @@ assert(code.match(/background-color:\s*?transparent;/gi)); assert(code.match(/border-radius:\s*?50%;/gi)); ``` -更改 `box-shadow` 屬性,使其 `offset-x` 爲 25px,`offset-y` 爲 10px,`blur-radius` 爲 0,`spread-radius` 爲 0,顏色爲 `blue`。 +更改 `box-shadow` 屬性,使其 `offset-x` 爲 25px,`offset-y` 爲 10px,`blur-radius` 爲 0,`spread-radius` 爲 0,`color` 爲 `blue`。 ```js assert( diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/applied-visual-design/create-a-more-complex-shape-using-css-and-html.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/applied-visual-design/create-a-more-complex-shape-using-css-and-html.md index e385fae5b3..4eb3da185b 100644 --- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/applied-visual-design/create-a-more-complex-shape-using-css-and-html.md +++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/applied-visual-design/create-a-more-complex-shape-using-css-and-html.md @@ -28,15 +28,15 @@ dashedName: create-a-more-complex-shape-using-css-and-html # --instructions-- -把屏幕裏的元素變成心形。 在 `heart::after` 選擇器裏,把 `background-color` 改成 `pink`,把 `border-radius` 改成 50%。 +把屏幕裏的元素變成心形。 在 `.heart::after` 選擇器裏,把 `background-color` 改成 `pink`,把 `border-radius` 改成 50%。 接下來,用類選擇器選取 class 爲 `heart`(只是 `heart`)的元素,爲它添加 `transform` 屬性。 使用 `rotate()` 函數並設置角度爲 -45 度。 -最後,在 `heart::before` 選擇器裏面,設置 `content` 屬性值爲空字符串。 +最後,在 `,heart::before` 選擇器裏面,設置 `content` 屬性值爲空字符串。 # --hints-- -`heart::after` 選擇器的 `background-color` 屬性值應爲 `pink`。 +`.heart::after` 選擇器的 `background-color` 屬性值應爲 `pink`。 ```js const heartAfter = code.match(/\.heart::after\s*{[\s\S]+?[^\}]}/g)[0]; @@ -45,7 +45,7 @@ assert( ); ``` -`heart::after` 僞元素的 `border-radius` 屬性值應爲 50%。 +`.heart::after` 僞元素的 `border-radius` 屬性值應爲 50%。 ```js assert(code.match(/border-radius\s*?:\s*?50%/gi).length == 2); @@ -57,7 +57,7 @@ class 爲 `heart` 的元素的 `transform` 屬性應使用 `rotate()` 函數並 assert(code.match(/transform\s*?:\s*?rotate\(\s*?-45deg\s*?\)/gi)); ``` -`heart::before` 僞元素的 `content` 應爲空字符串。 +`.heart::before` 僞元素的 `content` 應爲空字符串。 ```js assert(code.match(/\.heart::before\s*?{\s*?content\s*?:\s*?("|')\1\s*?;/gi)); diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/applied-visual-design/use-a-bezier-curve-to-move-a-graphic.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/applied-visual-design/use-a-bezier-curve-to-move-a-graphic.md index 4564c6f8dc..07424eec6c 100644 --- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/applied-visual-design/use-a-bezier-curve-to-move-a-graphic.md +++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/applied-visual-design/use-a-bezier-curve-to-move-a-graphic.md @@ -11,7 +11,7 @@ dashedName: use-a-bezier-curve-to-move-a-graphic 前面的關卡涉及了使用 `ease-out` 預定義值描述了動畫以高速開始低速結束。 右邊的動畫展示了 `ease-out` 效果(藍色的元素)和 `linear` 效果(紅色的元素)的區別。 同樣的,`ease-out` 預定義值也可以用貝塞爾曲線函數實現。 -通俗的講,將一條直線放在範圍只有 1 的座標軸中,並從中間拿 `p1` 和 `p2` 兩個點來拉扯(X 軸的取值區間是 \[0, 1],Y 軸任意),最後形成的曲線就是動畫的貝塞爾速度曲線。 下面是貝塞爾曲線模仿 ease-out 預定義值的例子: +通俗的講,將一條直線放在範圍只有 1 的座標軸中,並從中間拿 `p1` 和 `p2` 兩個點來拉扯(X 軸的取值區間是 \[0, 1],Y 軸任意),最後形成的曲線就是動畫的貝塞爾速度曲線。 下面是一個使用值來模仿 `ease-out` 樣式的 Bezier 曲線示例: ```css animation-timing-function: cubic-bezier(0, 0, 0.58, 1); diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/applied-visual-design/use-a-css-linear-gradient-to-create-a-striped-element.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/applied-visual-design/use-a-css-linear-gradient-to-create-a-striped-element.md index 48be9ab988..4d9cc19dd4 100644 --- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/applied-visual-design/use-a-css-linear-gradient-to-create-a-striped-element.md +++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/applied-visual-design/use-a-css-linear-gradient-to-create-a-striped-element.md @@ -47,7 +47,7 @@ assert(!code.match(/90deg/gi)); assert(code.match(/yellow\s+?0(px)?/gi)); ``` -40px 處的一個漸變顏色應該是 `yellow`。 +40 像素處的第一個色標應該是 `yellow`。 ```js assert(code.match(/yellow\s+?40px/gi)); diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/basic-css/change-a-variable-for-a-specific-area.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/basic-css/change-a-variable-for-a-specific-area.md index 2bfd6c5228..ee1831a378 100644 --- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/basic-css/change-a-variable-for-a-specific-area.md +++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/basic-css/change-a-variable-for-a-specific-area.md @@ -11,7 +11,7 @@ dashedName: change-a-variable-for-a-specific-area 當你在 `:root` 裏創建變量時,這些變量的作用域是整個頁面。 -如果在元素裏創建相同的變量,會重寫作用於整個頁面的變量的值。 +然後,你可以通過在一個特定的選擇器中再次設置這些變量來重寫這些變量。 # --instructions-- @@ -27,7 +27,7 @@ assert( ); ``` -`penguin` class 不應該包含 `background-color` 屬性。 +`penguin` 類不應包含 `background-color` 屬性。 ```js assert( diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/basic-css/create-a-custom-css-variable.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/basic-css/create-a-custom-css-variable.md index e7157a9f81..80df381574 100644 --- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/basic-css/create-a-custom-css-variable.md +++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/basic-css/create-a-custom-css-variable.md @@ -15,7 +15,7 @@ dashedName: create-a-custom-css-variable --penguin-skin: gray; ``` -這樣就會創建一個 `--penguin-skin` 變量,它的值爲 `gray`。 現在,其他元素可通過該變量來使元素變成灰色。 +這樣就會創建一個 `--penguin-skin` 變量,它的值爲 `gray`。 現在你可以在你的 CSS 中的其他地方使用這個變量來改變其他屬性的值爲灰色。 # --instructions-- diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/basic-css/inherit-styles-from-the-body-element.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/basic-css/inherit-styles-from-the-body-element.md index f1a8db0a5c..92bf5bab5a 100644 --- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/basic-css/inherit-styles-from-the-body-element.md +++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/basic-css/inherit-styles-from-the-body-element.md @@ -77,7 +77,7 @@ assert( ); ``` -`h1` 元素的字體顏色應繼承 `body` 元素所設置的綠色。 +`h1` 元素應該繼承 `body` 的 `green` 顏色屬性。 ```js assert($('h1').length > 0 && $('h1').css('color') === 'rgb(0, 128, 0)'); diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/basic-css/use-a-media-query-to-change-a-variable.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/basic-css/use-a-media-query-to-change-a-variable.md index 3ec6d996c1..d66d48f7c9 100644 --- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/basic-css/use-a-media-query-to-change-a-variable.md +++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/basic-css/use-a-media-query-to-change-a-variable.md @@ -15,7 +15,7 @@ CSS 變量可以簡化媒體查詢的定義方式。 # --instructions-- -在 `media query`(媒體查詢)聲明的 `:root` 選擇器裏,重定義 `--penguin-size` 的值爲 `200px`。 同時,重新定義 `--penguin-skin` 的值爲 `black`, 然後通過縮放頁面來查看它們是否生效。 +在媒體查詢聲明的 `:root` 選擇器裏,重定義 `--penguin-size` 的值爲 `200px`。 同時,重新定義 `--penguin-skin` 的值爲 `black`, 然後通過縮放頁面來查看它們是否生效。 # --hints-- diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/basic-css/use-abbreviated-hex-code.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/basic-css/use-abbreviated-hex-code.md index f4f0454fb6..ec1049f8fe 100644 --- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/basic-css/use-abbreviated-hex-code.md +++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/basic-css/use-abbreviated-hex-code.md @@ -29,7 +29,7 @@ dashedName: use-abbreviated-hex-code assert($('.red-text').css('color') === 'rgb(255, 0, 0)'); ``` -應使用紅色的 `hex code` 縮寫形式,不應使用 `#FF0000`。 +應使用紅色的縮寫十六進制代碼,而不是十六進制代碼 `#FF0000`。 ```js assert(code.match(/\.red-text\s*?{\s*?color\s*:\s*?#F00\s*?;?\s*?}/gi)); @@ -41,7 +41,7 @@ assert(code.match(/\.red-text\s*?{\s*?color\s*:\s*?#F00\s*?;?\s*?}/gi)); assert($('.green-text').css('color') === 'rgb(0, 255, 0)'); ``` -應使用綠色的 `hex code` 縮寫形式,不應使用 `#00FF00`。 +應使用綠色的縮寫十六進制代碼,而不是十六進制代碼 `#00FF00`。 ```js assert(code.match(/\.green-text\s*?{\s*?color\s*:\s*?#0F0\s*?;?\s*?}/gi)); @@ -53,7 +53,7 @@ assert(code.match(/\.green-text\s*?{\s*?color\s*:\s*?#0F0\s*?;?\s*?}/gi)); assert($('.cyan-text').css('color') === 'rgb(0, 255, 255)'); ``` -應使用藍綠色的 `hex code` 縮寫形式,不應使用 `#00FFFF`。 +應使用青色的簡寫十六進制代碼,而不是十六進制代碼 `#00FFFF`。 ```js assert(code.match(/\.cyan-text\s*?{\s*?color\s*:\s*?#0FF\s*?;?\s*?}/gi)); @@ -65,7 +65,7 @@ assert(code.match(/\.cyan-text\s*?{\s*?color\s*:\s*?#0FF\s*?;?\s*?}/gi)); assert($('.fuchsia-text').css('color') === 'rgb(255, 0, 255)'); ``` -應使用紫紅色的 `hex code` 縮寫形式,不應使用 `#FF00FF`。 +應使用紫紅色的簡寫十六進制代碼,而不是十六進制代碼 `#FF00FF`。 ```js assert(code.match(/\.fuchsia-text\s*?{\s*?color\s*:\s*?#F0F\s*?;?\s*?}/gi)); diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/basic-css/use-hex-code-for-specific-colors.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/basic-css/use-hex-code-for-specific-colors.md index cc5a1a8206..ebe2bb1610 100644 --- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/basic-css/use-hex-code-for-specific-colors.md +++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/basic-css/use-hex-code-for-specific-colors.md @@ -27,13 +27,13 @@ body { # --hints-- -`body` 元素的背景顏色應爲黑色。 +`body` 元素的 `background-color` 應爲黑色。 ```js assert($('body').css('background-color') === 'rgb(0, 0, 0)'); ``` -應使用 `hex code` 來替換 `black`。 +應該使用黑色的十六進制代碼,而不是 `black` 這個詞。 ```js assert( diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/basic-html-and-html5/check-radio-buttons-and-checkboxes-by-default.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/basic-html-and-html5/check-radio-buttons-and-checkboxes-by-default.md index 618ece4fab..4f8c4786e8 100644 --- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/basic-html-and-html5/check-radio-buttons-and-checkboxes-by-default.md +++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/basic-html-and-html5/check-radio-buttons-and-checkboxes-by-default.md @@ -11,7 +11,7 @@ dashedName: check-radio-buttons-and-checkboxes-by-default 用 `checked` 屬性把第一個複選框和單選按鈕都設置爲默認選中。 -在一個 input 元素裏面添加 `checked` 這個詞,即可實現。 例如: +爲此,只需將單詞 `checked` 添加到 `input` 元素的內部。 例如: ```html diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/basic-html-and-html5/comment-out-html.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/basic-html-and-html5/comment-out-html.md index 8ad833626d..4c736b33f8 100644 --- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/basic-html-and-html5/comment-out-html.md +++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/basic-html-and-html5/comment-out-html.md @@ -43,7 +43,7 @@ assert($('p').length === 0); assert(code.match(/[^fc]-->/g).length > 1); ``` -不要更改 `h1` 元素、`h2` 元素、`p` 元素的順序。 +不要更改 `h1`、`h2`、`p` 元素的順序。 ```js assert( diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/basic-html-and-html5/inform-with-the-paragraph-element.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/basic-html-and-html5/inform-with-the-paragraph-element.md index 46626220fa..5bf539ee7e 100644 --- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/basic-html-and-html5/inform-with-the-paragraph-element.md +++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/basic-html-and-html5/inform-with-the-paragraph-element.md @@ -9,7 +9,7 @@ dashedName: inform-with-the-paragraph-element # --description-- -`p` 元素是網站上段落文本使用的元素。 `p` 是“paragraph(段落)”的縮寫。 +`p` 元素是網站上段落文本的首選元素。 `p` 是“paragraph(段落)”的縮寫。 你可以像這樣創建一個段落: diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-flexbox/align-elements-using-the-justify-content-property.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-flexbox/align-elements-using-the-justify-content-property.md index 9523daa918..8ffd31a75d 100644 --- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-flexbox/align-elements-using-the-justify-content-property.md +++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-flexbox/align-elements-using-the-justify-content-property.md @@ -17,7 +17,7 @@ flex 子元素有時不能充滿整個 flex 容器, 所以我們經常需要 對於如何沿主軸線排放 flex 項目,有幾種選擇。 很常用的一種是 `justify-content: center;`:即 flex 子元素在 flex 容器中居中排列。 其他選擇包括: - + # --instructions-- diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-flexbox/use-the-flex-wrap-property-to-wrap-a-row-or-column.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-flexbox/use-the-flex-wrap-property-to-wrap-a-row-or-column.md index 213cbe47ed..d66fe12ddc 100644 --- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-flexbox/use-the-flex-wrap-property-to-wrap-a-row-or-column.md +++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-flexbox/use-the-flex-wrap-property-to-wrap-a-row-or-column.md @@ -9,7 +9,7 @@ dashedName: use-the-flex-wrap-property-to-wrap-a-row-or-column # --description-- -CSS flexbox 有一個把 flex 子元素拆分爲多行(或多列)的特性。 默認情況下,flex 容器會調整項目大小,把它們都塞到一起。 對於行來說,所有項目都會在一條直線上。 +CSS flexbox 具有將 flex 容器拆分爲多行(或列)的功能。 默認情況下,flex 容器會調整項目大小,把它們都塞到一起。 對於行來說,所有項目都會在一條直線上。 不過,使用 `flex-wrap` 屬性可以使項目換行展示。 這意味着多出來的子元素會被移到新的行或列。 換行發生的斷點由子元素和容器的大小決定。 diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/place-items-in-grid-areas-using-the-grid-area-property.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/place-items-in-grid-areas-using-the-grid-area-property.md index af1df38e53..d366b7adcd 100644 --- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/place-items-in-grid-areas-using-the-grid-area-property.md +++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/place-items-in-grid-areas-using-the-grid-area-property.md @@ -17,7 +17,7 @@ dashedName: place-items-in-grid-areas-using-the-grid-area-property } ``` -這樣,class 爲 `item1` 的網格項就被放到了 `header` 區域裏。 在這個示例中,網格項將佔用第一行整行,因爲這一整行都被命名爲標題區域。 +這樣,class 爲 `item1` 的網格項就被放到了 `header` 區域裏。 在這種情況下,該項目將使用整個頂行,因爲該整行被命名爲 `header` 區域。 # --instructions-- diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/use-css-grid-units-to-change-the-size-of-columns-and-rows.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/use-css-grid-units-to-change-the-size-of-columns-and-rows.md index 5eb6ad0470..de2781f1ed 100644 --- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/use-css-grid-units-to-change-the-size-of-columns-and-rows.md +++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/css-grid/use-css-grid-units-to-change-the-size-of-columns-and-rows.md @@ -31,7 +31,7 @@ grid-template-columns: auto 50px 10% 2fr 1fr; # --hints-- -class 爲 `container` 的元素應具有 `grid-template-columns` 屬性且屬性值應爲 `1fr 100px 2fr`。 +`container` 類應該有一個 `grid-template-columns` 屬性,該屬性具有以下寬度的三列:`1fr`、`100px` 和 `2fr`。 ```js assert( diff --git a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/convert-celsius-to-fahrenheit.md b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/convert-celsius-to-fahrenheit.md index 2d320ffa6c..7d6aad7e37 100644 --- a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/convert-celsius-to-fahrenheit.md +++ b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/convert-celsius-to-fahrenheit.md @@ -8,9 +8,9 @@ dashedName: convert-celsius-to-fahrenheit # --description-- -將攝氏度轉換爲華氏度的計算方式爲:攝氏度乘以 `9/5` 然後加上 `32`。 +從攝氏轉換爲華氏的公式是,攝氏溫度乘以 `9/5`,再加上 `32`。 -輸入參數 `celsius` 代表一個攝氏度的溫度。 使用已定義的變量 `fahrenheit`,並賦值爲相應的華氏度的溫度值。 根據上述轉換公式來進行轉換。 +輸入參數 `celsius` 代表一個攝氏度的溫度。 使用已定義的變量 `fahrenheit`,並賦值爲相應的華氏度的溫度值。 使用上面提到的公式來幫助將攝氏溫度轉換爲華氏溫度。 # --hints-- diff --git a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-data-structures/check-if-an-object-has-a-property.md b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-data-structures/check-if-an-object-has-a-property.md index 942ea6fef7..f0f51ba526 100644 --- a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-data-structures/check-if-an-object-has-a-property.md +++ b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-data-structures/check-if-an-object-has-a-property.md @@ -19,7 +19,7 @@ users.hasOwnProperty('Alan'); # --instructions-- -請完善這個函數,如果傳遞給它的對象包含四個名字 `Alan`、`Jeff`、`Sarah` 和 `Ryan`,函數返回 true,否則返回 false。 +請完善這個函數,如果傳遞給它的對象包含四個名字 `Alan`、`Jeff`、`Sarah` 和 `Ryan`,函數返回 `true`,否則返回 `false`。 # --hints-- diff --git a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-data-structures/remove-items-using-splice.md b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-data-structures/remove-items-using-splice.md index 8e0fd29240..c2e13a57f3 100644 --- a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-data-structures/remove-items-using-splice.md +++ b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-data-structures/remove-items-using-splice.md @@ -10,7 +10,7 @@ dashedName: remove-items-using-splice 在之前的挑戰中,我們已經學習瞭如何用 `shift()` 和 `pop()` 從數組的開頭或末尾移除元素。 但如果我們想刪除數組中間的一個元素, 或者想一次刪除多個元素,該如何操作呢? 這時候我們就需要使用 `splice()` 方法了, `splice()` 可以讓我們從數組中的任意位置**連續刪除任意數量的元素**。 -`splice()` 最多可以接受 3 個參數,但現在我們先關注前兩個。 `splice()` 接收的前兩個參數是整數,表示正在調用 的`splice()` 數組中的元素的索引或位置。 別忘了,數組的索引是*從 0 開始的*,所以我們要用 `0` 來表示數組中的第一個元素。 `splice()` 的第一個參數代表從數組中的哪個索引開始移除元素,而第二個參數表示要從數組中的這個位置開始刪除多少個元素。 例如: +`splice()` 最多可以接受 3 個參數,但現在我們先關注前兩個。 `splice()` 的前兩個參數是整數,表示數組中調用 `splice()` 的項的索引或位置。 別忘了,數組的索引是*從 0 開始的*,所以我們要用 `0` 來表示數組中的第一個元素。 `splice()` 的第一個參數代表從數組中的哪個索引開始移除元素,而第二個參數表示要從數組中的這個位置開始刪除多少個元素。 例如: ```js let array = ['today', 'was', 'not', 'so', 'great']; diff --git a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-inequality-operator.md b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-inequality-operator.md index a5e888650e..c584133299 100644 --- a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-inequality-operator.md +++ b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-inequality-operator.md @@ -14,18 +14,16 @@ dashedName: comparison-with-the-inequality-operator **例如** ```js -1 != 2 -1 != "1" -1 != '1' -1 != true -0 != false +1 != 2 // true +1 != "1" // false +1 != '1' // false +1 != true // false +0 != false // false ``` -按順序,這些表達式會返回 `true`、`false`、`false`、`false` 和 `false`。 - # --instructions-- -在 `if` 語句中添加不等運算符 `!=` 以便函數在 `val` 不等於 `99` 時返回字符串 `Not Equal`。 +在 `if` 語句中添加不等式運算符 `!=` 以便函數在 `val` 不等於 `99` 時返回字符串 `Not Equal`。 # --hints-- @@ -59,7 +57,7 @@ assert(testNotEqual('12') === 'Not Equal'); assert(testNotEqual('bob') === 'Not Equal'); ``` -你應該使用 `!=` 運算符。 +你應該使用 `!=` 運算符 ```js assert(code.match(/(?!!==)!=/)); diff --git a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-less-than-operator.md b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-less-than-operator.md index 894ffb329d..3cfac46864 100644 --- a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-less-than-operator.md +++ b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-less-than-operator.md @@ -14,58 +14,56 @@ dashedName: comparison-with-the-less-than-operator **例如:** ```js -2 < 5 -'3' < 7 -5 < 5 -3 < 2 -'8' < 4 +2 < 5 // true +'3' < 7 // true +5 < 5 // false +3 < 2 // false +'8' < 4 // false ``` -按順序,這些表達式會返回 `true`、`true`、`false`、`false` 和 `false`。 - # --instructions-- -添加小於運算符到指定行,使得函數的返回語句有意義。 +將小於運算符添加到指示的行,以便返回語句有意義。 # --hints-- -`testLessThan(0)` 應該返回字符串 `Under 25`。 +`testLessThan(0)` 應該返回字符串 `Under 25` ```js assert(testLessThan(0) === 'Under 25'); ``` -`testLessThan(24)` 應該返回字符串 `Under 25`。 +`testLessThan(24)` 應該返回字符串 `Under 25` ```js assert(testLessThan(24) === 'Under 25'); ``` -`testLessThan(25)` 應該返回字符串 `Under 55`。 +`testLessThan(25)` 應該返回字符串 `Under 55` ```js assert(testLessThan(25) === 'Under 55'); ``` -`testLessThan(54)` 應該返回字符串 `Under 55`。 +`testLessThan(54)` 應該返回字符串 `Under 55` ```js assert(testLessThan(54) === 'Under 55'); ``` -`testLessThan(55)` 應該返回字符串 `55 or Over`。 +`testLessThan(55)` 應該返回字符串 `55 or Over` ```js assert(testLessThan(55) === '55 or Over'); ``` -`testLessThan(99)` 應該返回字符串 `55 or Over`。 +`testLessThan(99)` 應該返回字符串 `55 or Over` ```js assert(testLessThan(99) === '55 or Over'); ``` -應該使用 `<` 運算符至少兩次。 +應該使用 `<` 運算符至少兩次 ```js assert(code.match(/val\s*<\s*('|")*\d+('|")*/g).length > 1); diff --git a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-less-than-or-equal-to-operator.md b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-less-than-or-equal-to-operator.md index 02a099677b..da386b35ec 100644 --- a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-less-than-or-equal-to-operator.md +++ b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-less-than-or-equal-to-operator.md @@ -14,18 +14,16 @@ dashedName: comparison-with-the-less-than-or-equal-to-operator **例如** ```js -4 <= 5 -'7' <= 7 -5 <= 5 -3 <= 2 -'8' <= 4 +4 <= 5 // true +'7' <= 7 // true +5 <= 5 // true +3 <= 2 // false +'8' <= 4 // false ``` -按順序,這些表達式會返回 `true`、`true`、`true`、`false` 和 `false`。 - # --instructions-- -添加小於等於運算符到指定行,使得函數的返回語句有意義。 +將小於或等於運算符添加到指示的行,以便返回語句有意義。 # --hints-- diff --git a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-strict-equality-operator.md b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-strict-equality-operator.md index a2c7cd312c..784409a7ed 100644 --- a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-strict-equality-operator.md +++ b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-strict-equality-operator.md @@ -16,17 +16,15 @@ dashedName: comparison-with-the-strict-equality-operator **示例** ```js -3 === 3 -3 === '3' +3 === 3 // true +3 === '3' // false ``` -這些條件將分別返回 `true` and `false`。 - 在第二個例子中,`3` 是一個 `Number` 類型,而 `'3'` 是一個 `String` 類型。 # --instructions-- -在 `if` 語句中使用嚴格相等運算符,這樣當 `val` 嚴格等於 `7` 時,函數將返回字符串 `Equal`。 +在 `if` 語句中使用嚴格相等運算符,這樣函數將在 `val` 嚴格等於 `7` 時返回字符串 `Equal`。 # --hints-- @@ -48,7 +46,7 @@ assert(testStrict(7) === 'Equal'); assert(testStrict('7') === 'Not Equal'); ``` -你應該使用 `===` 運算符。 +應該使用 `===` 運算符 ```js assert(code.match(/(val\s*===\s*\d+)|(\d+\s*===\s*val)/g).length > 0); diff --git a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-strict-inequality-operator.md b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-strict-inequality-operator.md index 89487b9757..2dff6ed7fe 100644 --- a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-strict-inequality-operator.md +++ b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-strict-inequality-operator.md @@ -14,13 +14,11 @@ dashedName: comparison-with-the-strict-inequality-operator **示例** ```js -3 !== 3 -3 !== '3' -4 !== 3 +3 !== 3 // false +3 !== '3' // true +4 !== 3 // true ``` -按順序,這些表達式會返回 `false`、`true`、`true`。 - # --instructions-- 在 `if` 語句中,添加嚴格不相等運算符,這樣函數在當 `val` 不嚴格等於 `17` 的時候,會返回 `Not Equal`。 @@ -51,7 +49,7 @@ assert(testStrictNotEqual(12) === 'Not Equal'); assert(testStrictNotEqual('bob') === 'Not Equal'); ``` -應該使用 `!==` 運算符。 +應該使用 `!==` 運算符 ```js assert(code.match(/(val\s*!==\s*\d+)|(\d+\s*!==\s*val)/g).length > 0); diff --git a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/counting-cards.md b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/counting-cards.md index fe9c860c58..facfb5dedd 100644 --- a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/counting-cards.md +++ b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/counting-cards.md @@ -25,7 +25,7 @@ dashedName: counting-cards # --hints-- -卡牌序列 2、3、4、5、6 應該返回 `5 Bet` +卡片序列 2、3、4、5、6 應返回字符串 `5 Bet` ```js assert( diff --git a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/declare-a-read-only-variable-with-the-const-keyword.md b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/declare-a-read-only-variable-with-the-const-keyword.md index 96d4da3c80..a60941f01c 100644 --- a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/declare-a-read-only-variable-with-the-const-keyword.md +++ b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/declare-a-read-only-variable-with-the-const-keyword.md @@ -21,32 +21,28 @@ FAV_PET = "Dogs"; 你應該始終使用 `const` 關鍵字命名不想重新分配的變量。 這有助於避免給一個常量進行額外的再次賦值。 -命名常量的常見做法是全部使用大寫字母,單詞之間用下劃線分隔。 - -**注意:** 對於不可變值,開發人員通常使用大寫變量標識符,對可變值(對象和數組)使用小寫或駝峯式標識符。 你將在後面的挑戰中瞭解有關對象、數組以及不可變和可變值的更多信息。 同樣在後面的挑戰中,你將看到大寫、小寫或駝峯式變量標識符的示例。 +**注意:** 通常,開發者會用大寫字母作爲常量標識符,用小寫字母或者駝峯命名作爲變量(對象或數組)標識符。 你將在後面的挑戰中瞭解有關對象、數組以及不可變和可變值的更多信息。 同樣在後面的挑戰中,你將看到大寫、小寫或駝峯式變量標識符的示例。 # --instructions-- -更改代碼,以便使用 `let` 或 `const` 聲明所有變量。 當你希望變量改變時使用 `let`,而當你希望變量保持不變時使用 `const`。 此外,重命名用 `const` 聲明的變量以符合常見做法,這意味着常量應該全部大寫。 +更改代碼,以便使用 `let` 或 `const` 聲明所有變量。 當你想要改變變量時使用 `let`,當你想要變量保持不變時使用 `const`。 此外,重命名使用 `const` 聲明的變量以符合慣例。 # --hints-- -`var` 不應存在於你的代碼中。 +代碼中不應有 `var`。 ```js -(getUserInput) => assert(!getUserInput('index').match(/var/g)); +assert.notMatch(code, /var/g); ``` 你應該將 `fCC` 更改爲全部大寫。 ```js -(getUserInput) => { - assert(getUserInput('index').match(/(FCC)/)); - assert(!getUserInput('index').match(/fCC/)); -} +assert.match(code, /(FCC)/); +assert.notMatch(code, /(fCC)/); ``` -`FCC` 應該是一個用 `const` 聲明的常量變量。 +`FCC` 應該是一個用 `const` 聲明的常量。 ```js assert.equal(FCC, 'freeCodeCamp'); @@ -56,14 +52,13 @@ assert.match(code, /const\s+FCC/); `fact` 應該用 `let` 聲明。 ```js -(getUserInput) => assert(getUserInput('index').match(/(let fact)/g)); +assert.match(code, /(let\s+fact)/g); ``` `console.log` 應該更改爲打印 `FCC` 和 `fact` 變量。 ```js -(getUserInput) => - assert(getUserInput('index').match(/console\.log\(\s*FCC\s*\,\s*fact\s*\)\s*;?/g)); +assert.match(code, /console\.log\(\s*FCC\s*\,\s*fact\s*\)\s*;?/g); ``` # --seed-- diff --git a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/decrement-a-number-with-javascript.md b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/decrement-a-number-with-javascript.md index 936ad97e8e..81e322ff7c 100644 --- a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/decrement-a-number-with-javascript.md +++ b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/decrement-a-number-with-javascript.md @@ -38,9 +38,13 @@ assert(myVar === 10); 應該修改 `myVar = myVar - 1;`。 ```js -assert( - /let\s*myVar\s*=\s*11;\s*\/*.*\s*([-]{2}\s*myVar|myVar\s*[-]{2});/.test(code) -); +assert(!code.match(/myVar\s*=\s*myVar\s*[-]\s*1.*?;?/)); +``` + +你不應將 `10` 分配給 `myVar`。 + +```js +assert(!code.match(/myVar\s*=\s*10.*?;?/)); ``` 應該對 `myVar` 使用 `--` 運算符。 @@ -49,7 +53,7 @@ assert( assert(/[-]{2}\s*myVar|myVar\s*[-]{2}/.test(code)); ``` -不應修改註釋上方的代碼。 +你不應該修改註釋上面的代碼。 ```js assert(/let myVar = 11;/.test(code)); diff --git a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/local-scope-and-functions.md b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/local-scope-and-functions.md index a3af68c767..628ae3dcb8 100644 --- a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/local-scope-and-functions.md +++ b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/local-scope-and-functions.md @@ -23,7 +23,7 @@ myTest(); console.log(loc); ``` -`myTest()` 函數調用將在控制檯中顯示字符串 `foo`。 `console.log(loc)` 行會產生一個錯誤,因爲 `loc` 沒有定義在函數之外。 +`myTest()` 函數調用將在控制檯中顯示字符串 `foo`。 `console.log(loc)` 行(在 `myTest` 函數之外)將拋出錯誤,因爲 `loc` 未在函數之外定義。 # --instructions-- diff --git a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/record-collection.md b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/record-collection.md index 2c700ef03f..81b1216dc3 100644 --- a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/record-collection.md +++ b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/record-collection.md @@ -31,13 +31,13 @@ assert( ); ``` -執行 `updateRecords(recordCollection, 5439, "tracks", "Take a Chance on Me")` 後,`tracks` 的最後一個元素應該爲字符串 `Take a Chance on Me`。 +在 `updateRecords(recordCollection, 5439, "tracks", "Take a Chance on Me")` 之後,`tracks` 應該有字符串 `Take a Chance on Me` 作爲最後一個也是唯一的元素。 ```js assert( - updateRecords(_recordCollection, 5439, 'tracks', 'Take a Chance on Me')[5439][ - 'tracks' - ].pop() === 'Take a Chance on Me' + updateRecords(_recordCollection, 5439, 'tracks', 'Take a Chance on Me') && + _recordCollection[5439]['tracks'].length === 1 && + _recordCollection[5439]['tracks'].pop() === 'Take a Chance on Me' ); ``` diff --git a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/understanding-uninitialized-variables.md b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/understanding-uninitialized-variables.md index 540036f5c2..3210dfa7c1 100644 --- a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/understanding-uninitialized-variables.md +++ b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/understanding-uninitialized-variables.md @@ -9,7 +9,7 @@ dashedName: understanding-uninitialized-variables # --description-- -當 JavaScript 中的變量被聲明的時候,程序內部會給它一個初始值 `undefined`。 當你對一個值爲 `undefined` 的變量進行運算操作的時候,算出來的結果將會是 `NaN`,它的意思是 "Not a Number"。 當你用一個值是 `undefined` 的變量來做字符串拼接操作的時候,它會轉換成字符串(string)`undefined`。 +當 JavaScript 中的變量被聲明的時候,程序內部會給它一個初始值 `undefined`。 當你對一個值爲 `undefined` 的變量進行運算操作的時候,算出來的結果將會是 `NaN`,它的意思是 "Not a Number"。 如果你用 `undefined` 變量連接一個字符串,你將得到一個 `undefined` 的 字符串。 # --instructions-- diff --git a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-first-character-in-a-string.md b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-first-character-in-a-string.md index 47dff8295c..1f41c91343 100644 --- a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-first-character-in-a-string.md +++ b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-first-character-in-a-string.md @@ -41,7 +41,7 @@ assert(firstLetterOfLastName === 'L'); 應該使用方括號表示法。 ```js -assert(code.match(/firstLetterOfLastName\s*?=\s*?lastName\[.*?\]/)); +assert(code.match(/firstLetterOfLastName\s*=\s*lastName\s*\[\s*\d\s*\]/)); ``` # --seed-- diff --git a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-nth-character-in-a-string.md b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-nth-character-in-a-string.md index b48a3627a5..23babc5302 100644 --- a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-nth-character-in-a-string.md +++ b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-nth-character-in-a-string.md @@ -39,7 +39,7 @@ assert(thirdLetterOfLastName === 'v'); 應該使用方括號表示法。 ```js -assert(code.match(/thirdLetterOfLastName\s*?=\s*?lastName\[.*?\]/)); +assert(code.match(/thirdLetterOfLastName\s*=\s*lastName\s*\[\s*\d\s*\]/)); ``` # --seed-- diff --git a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/functional-programming/refactor-global-variables-out-of-functions.md b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/functional-programming/refactor-global-variables-out-of-functions.md index 0f96ede20c..0ac50d3144 100644 --- a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/functional-programming/refactor-global-variables-out-of-functions.md +++ b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/functional-programming/refactor-global-variables-out-of-functions.md @@ -27,6 +27,7 @@ dashedName: refactor-global-variables-out-of-functions `bookList` 應等於 `["The Hound of the Baskervilles", "On The Electrodynamics of Moving Bodies", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae"]`. ```js +add(bookList, "Test"); assert( JSON.stringify(bookList) === JSON.stringify([ @@ -38,11 +39,11 @@ assert( ); ``` -`newBookList` 應等於 `["The Hound of the Baskervilles", "On The Electrodynamics of Moving Bodies", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae", "A Brief History of Time"]`. +`add(bookList, "A Brief History of Time")` 應該返回 `["The Hound of the Baskervilles", "On The Electrodynamics of Moving Bodies", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae", "A Brief History of Time"]`。 ```js assert( - JSON.stringify(newBookList) === + JSON.stringify(add(bookList, "A Brief History of Time")) === JSON.stringify([ 'The Hound of the Baskervilles', 'On The Electrodynamics of Moving Bodies', @@ -53,11 +54,11 @@ assert( ); ``` -`newerBookList` 應等於 `["The Hound of the Baskervilles", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae"]`. +`remove(bookList, "On The Electrodynamics of Moving Bodies")` 應該返回 `["The Hound of the Baskervilles", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae"]`。 ```js assert( - JSON.stringify(newerBookList) === + JSON.stringify(remove(bookList, 'On The Electrodynamics of Moving Bodies')) === JSON.stringify([ 'The Hound of the Baskervilles', 'Philosophiæ Naturalis Principia Mathematica', @@ -66,11 +67,11 @@ assert( ); ``` -`newestBookList` 應等於 `["The Hound of the Baskervilles", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae", "A Brief History of Time"]`. +`remove(add(bookList, "A Brief History of Time"), "On The Electrodynamics of Moving Bodies");` 應該返回 `["The Hound of the Baskervilles", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae", "A Brief History of Time"]`。 ```js assert( - JSON.stringify(newestBookList) === + JSON.stringify(remove(add(bookList, 'A Brief History of Time'), 'On The Electrodynamics of Moving Bodies')) === JSON.stringify([ 'The Hound of the Baskervilles', 'Philosophiæ Naturalis Principia Mathematica', @@ -108,12 +109,6 @@ function remove(bookName) { // Change code above this line } } - -const newBookList = add(bookList, 'A Brief History of Time'); -const newerBookList = remove(bookList, 'On The Electrodynamics of Moving Bodies'); -const newestBookList = remove(add(bookList, 'A Brief History of Time'), 'On The Electrodynamics of Moving Bodies'); - -console.log(bookList); ``` # --solutions-- @@ -134,8 +129,4 @@ function remove(bookList, bookName) { } return bookListCopy; } - -const newBookList = add(bookList, 'A Brief History of Time'); -const newerBookList = remove(bookList, 'On The Electrodynamics of Moving Bodies'); -const newestBookList = remove(add(bookList, 'A Brief History of Time'), 'On The Electrodynamics of Moving Bodies'); ``` diff --git a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/arguments-optional.md b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/arguments-optional.md index 931c039647..c1fe4ee756 100644 --- a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/arguments-optional.md +++ b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/arguments-optional.md @@ -60,6 +60,12 @@ assert.isUndefined(addTogether(2, '3')); assert.isUndefined(addTogether(2)([3])); ``` +`addTogether("2", 3)` 應該返回 `undefined`。 + +```js +assert.isUndefined(addTogether('2', 3)); +``` + # --seed-- ## --seed-contents-- diff --git a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/everything-be-true.md b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/everything-be-true.md index b11a7b8784..59d7ae2bbe 100644 --- a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/everything-be-true.md +++ b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/everything-be-true.md @@ -18,120 +18,123 @@ JavaScript 中,如果一個值在 Boolean 的上下文中的執行結果爲 `t # --hints-- -`truthCheck([{"user": "Tinky-Winky", "sex": "male"}, {"user": "Dipsy", "sex": "male"}, {"user": "Laa-Laa", "sex": "female"}, {"user": "Po", "sex": "female"}], "sex")` 應返回 `true`。 +`truthCheck([{name: "Quincy", role: "Founder", isBot: false}, {name: "Naomi", role: "", isBot: false}, {name: "Camperbot", role: "Bot", isBot: true}], "isBot")` 應該返回 `false`。 ```js -assert.strictEqual( - truthCheck( - [ - { user: 'Tinky-Winky', sex: 'male' }, - { user: 'Dipsy', sex: 'male' }, - { user: 'Laa-Laa', sex: 'female' }, - { user: 'Po', sex: 'female' } - ], - 'sex' - ), - true -); +assert.strictEqual(truthCheck( + [ + { name: "Quincy", role: "Founder", isBot: false }, + { name: "Naomi", role: "", isBot: false }, + { name: "Camperbot", role: "Bot", isBot: true } + ], + "isBot"), false); ``` -`truthCheck([{"user": "Tinky-Winky", "sex": "male"}, {"user": "Dipsy"}, {"user": "Laa-Laa", "sex": "female"}, {"user": "Po", "sex": "female"}], "sex")` 應返回 `false`。 +`truthCheck([{name: "Quincy", role: "Founder", isBot: false}, {name: "Naomi", role: "", isBot: false}, {name: "Camperbot", role: "Bot", isBot: true}], "name")` 應該返回 `true`。 ```js -assert.strictEqual( - truthCheck( - [ - { user: 'Tinky-Winky', sex: 'male' }, - { user: 'Dipsy' }, - { user: 'Laa-Laa', sex: 'female' }, - { user: 'Po', sex: 'female' } - ], - 'sex' - ), - false -); +assert.strictEqual(truthCheck( + [ + { name: "Quincy", role: "Founder", isBot: false }, + { name: "Naomi", role: "", isBot: false }, + { name: "Camperbot", role: "Bot", isBot: true } + ], + "name"), true); ``` -`truthCheck([{"user": "Tinky-Winky", "sex": "male", "age": 0}, {"user": "Dipsy", "sex": "male", "age": 3}, {"user": "Laa-Laa", "sex": "female", "age": 5}, {"user": "Po", "sex": "female", "age": 4}], "age")` 應返回 `false`。 +`truthCheck([{name: "Quincy", role: "Founder", isBot: false}, {name: "Naomi", role: "", isBot: false}, {name: "Camperbot", role: "Bot", isBot: true}], "role")` 應該返回 `false`。 ```js -assert.strictEqual( - truthCheck( - [ - { user: 'Tinky-Winky', sex: 'male', age: 2 }, - { user: 'Dipsy', sex: 'male', age: 0 }, - { user: 'Laa-Laa', sex: 'female', age: 5 }, - { user: 'Po', sex: 'female', age: 4 } - ], - 'age' - ), - false -); +assert.strictEqual(truthCheck( + [ + { name: "Quincy", role: "Founder", isBot: false }, + { name: "Naomi", role: "", isBot: false }, + { name: "Camperbot", role: "Bot", isBot: true } + ], + "role"), false); ``` -`truthCheck([{"name": "Pete", "onBoat": true}, {"name": "Repeat", "onBoat": true}, {"name": "FastForward", "onBoat": null}], "onBoat")` 應返回 `false`。 +`truthCheck([{name: "Pikachu", number: 25, caught: 3}, {name: "Togepi", number: 175, caught: 1}], "number")` 應該返回 `true`。 ```js -assert.strictEqual( - truthCheck( - [ - { name: 'Pete', onBoat: true }, - { name: 'Repeat', onBoat: true }, - { name: 'FastForward', onBoat: null } - ], - 'onBoat' - ), - false -); +assert.strictEqual(truthCheck( + [ + { name: "Pikachu", number: 25, caught: 3 }, + { name: "Togepi", number: 175, caught: 1 }, + ], + "number"), true); ``` -`truthCheck([{"name": "Pete", "onBoat": true}, {"name": "Repeat", "onBoat": true, "alias": "Repete"}, {"name": "FastForward", "onBoat": true}], "onBoat")` 應返回 `true`。 +`truthCheck([{name: "Pikachu", number: 25, caught: 3}, {name: "Togepi", number: 175, caught: 1}, {name: "MissingNo", number: NaN, caught: 0}], "caught")` 應該返回 `false`。 ```js -assert.strictEqual( - truthCheck( - [ - { name: 'Pete', onBoat: true }, - { name: 'Repeat', onBoat: true, alias: 'Repete' }, - { name: 'FastForward', onBoat: true } - ], - 'onBoat' - ), - true -); +assert.strictEqual(truthCheck( + [ + { name: "Pikachu", number: 25, caught: 3 }, + { name: "Togepi", number: 175, caught: 1 }, + { name: "MissingNo", number: NaN, caught: 0 }, + ], + "caught"), false); ``` -`truthCheck([{"single": "yes"}], "single")` 應返回 `true`。 +`truthCheck([{name: "Pikachu", number: 25, caught: 3}, {name: "Togepi", number: 175, caught: 1}, {name: "MissingNo", number: NaN, caught: 0}], "number")` 應該返回 `false`。 ```js -assert.strictEqual(truthCheck([{ single: 'yes' }], 'single'), true); +assert.strictEqual(truthCheck( + [ + { name: "Pikachu", number: 25, caught: 3 }, + { name: "Togepi", number: 175, caught: 1 }, + { name: "MissingNo", number: NaN, caught: 0 }, + ], + "number"), false); ``` -`truthCheck([{"single": ""}, {"single": "double"}], "single")` 應返回 `false`。 +`truthCheck([{name: "Quincy", username: "QuincyLarson"}, {name: "Naomi", username: "nhcarrigan"}, {name: "Camperbot"}], "username")` 應該返回 `false`。 ```js -assert.strictEqual( - truthCheck([{ single: '' }, { single: 'double' }], 'single'), - false -); +assert.strictEqual(truthCheck( + [ + { name: "Quincy", username: "QuincyLarson" }, + { name: "Naomi", username: "nhcarrigan" }, + { name: "Camperbot" } + ], + "username"), false); ``` -`truthCheck([{"single": "double"}, {"single": undefined}], "single")` 應返回 `false`。 +`truthCheck([{name: "freeCodeCamp", users: [{name: "Quincy"}, {name: "Naomi"}]}, {name: "Code Radio", users: [{name: "Camperbot"}]}, {name: "", users: []}], "users")` 應該返回 `true`。 ```js -assert.strictEqual( - truthCheck([{ single: 'double' }, { single: undefined }], 'single'), - false -); +assert.strictEqual(truthCheck( + [ + { name: "freeCodeCamp", users: [{ name: "Quincy" }, { name: "Naomi" }] }, + { name: "Code Radio", users: [{ name: "Camperbot" }] }, + { name: "", users: [] }, + ], + "users"), true); ``` -`truthCheck([{"single": "double"}, {"single": NaN}], "single")` 應返回 `false`。 +`truthCheck([{id: 1, data: {url: "https://freecodecamp.org", name: "freeCodeCamp"}}, {id: 2, data: {url: "https://coderadio.freecodecamp.org/", name: "CodeRadio"}}, {id: null, data: {}}], "data")` 應該返回 `true`。 ```js -assert.strictEqual( - truthCheck([{ single: 'double' }, { single: NaN }], 'single'), - false -); +assert.strictEqual(truthCheck( + [ + { id: 1, data: { url: "https://www.freecodecamp.org", name: "freeCodeCamp" } }, + { id: 2, data: { url: "https://coderadio.freecodecamp.org/", name: "CodeRadio" } }, + { id: null, data: {} }, + ], + "data"), true); +``` + +`truthCheck([{id: 1, data: {url: "https://freecodecamp.org", name: "freeCodeCamp"}}, {id: 2, data: {url: "https://coderadio.freecodecamp.org/", name: "CodeRadio"}}, {id: null, data: {}}], "id")` 應該返回 `false`。 + +```js +assert.strictEqual(truthCheck( + [ + { id: 1, data: { url: "https://www.freecodecamp.org", name: "freeCodeCamp" } }, + { id: 2, data: { url: "https://coderadio.freecodecamp.org/", name: "CodeRadio" } }, + { id: null, data: {} }, + ], + "id"), false); ``` # --seed-- @@ -143,7 +146,7 @@ function truthCheck(collection, pre) { return pre; } -truthCheck([{"user": "Tinky-Winky", "sex": "male"}, {"user": "Dipsy", "sex": "male"}, {"user": "Laa-Laa", "sex": "female"}, {"user": "Po", "sex": "female"}], "sex"); +truthCheck([{name: "Quincy", role: "Founder", isBot: false}, {name: "Naomi", role: "", isBot: false}, {name: "Camperbot", role: "Bot", isBot: true}], "isBot"); ``` # --solutions-- diff --git a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sorted-union.md b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sorted-union.md index 5916f08f7d..9df408baa0 100644 --- a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sorted-union.md +++ b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sorted-union.md @@ -45,6 +45,18 @@ assert.deepEqual(uniteUnique([1, 2, 3], [5, 2, 1, 4], [2, 1], [6, 7, 8]), [ ]); ``` +`uniteUnique([1, 3, 2], [5, 4], [5, 6])` 應該返回 `[1, 3, 2, 5, 4, 6]`。 + +```js +assert.deepEqual(uniteUnique([1, 3, 2], [5, 4], [5, 6]), [1, 3, 2, 5, 4, 6]); +``` + +`uniteUnique([1, 3, 2, 3], [5, 2, 1, 4], [2, 1])` 應該返回 `[1, 3, 2, 5, 4]`。 + +```js +assert.deepEqual(uniteUnique([1, 3, 2, 3], [5, 2, 1, 4], [2, 1]), [1, 3, 2, 5, 4]); +``` + # --seed-- ## --seed-contents-- @@ -62,7 +74,11 @@ uniteUnique([1, 3, 2], [5, 2, 1, 4], [2, 1]); ```js function uniteUnique(arr) { return [].slice.call(arguments).reduce(function(a, b) { - return [].concat(a, b.filter(function(e) {return a.indexOf(e) === -1;})); + return [].concat( + a, + b.filter(function(e, currentIndex) { + return b.indexOf(e) === currentIndex && a.indexOf(e) === -1; + })); }, []); } ``` diff --git a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/bootstrap/call-out-optional-actions-with-btn-info.md b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/bootstrap/call-out-optional-actions-with-btn-info.md index 94ff3458d7..cc587c5172 100644 --- a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/bootstrap/call-out-optional-actions-with-btn-info.md +++ b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/bootstrap/call-out-optional-actions-with-btn-info.md @@ -10,7 +10,7 @@ dashedName: call-out-optional-actions-with-btn-info Bootstrap 有着豐富的預定義按鈕顏色。 淺藍色的 `btn-info` class 通常用在備選操作上。 -在 `Like` 按鈕下方創建包含文本 `Info` 的塊級 Bootstrap 按鈕,然後爲該按鈕添加 Bootstrap 的 `btn-info` 和 `btn-block` classes。 +在 `Like` 按鈕下方使用文本 `Info` 創建一個新的塊級 Bootstrap 按鈕,並向其中添加 Bootstrap 的 `btn-info` 類。 注意:這些按鈕仍然需要 `btn` 和 `btn-block` class。 diff --git a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/react/render-conditionally-from-props.md b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/react/render-conditionally-from-props.md index 3e74ea1d38..b5356f2e79 100644 --- a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/react/render-conditionally-from-props.md +++ b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/react/render-conditionally-from-props.md @@ -8,7 +8,7 @@ dashedName: render-conditionally-from-props # --description-- -到目前爲止,已經看到了如何使用 `if/else`、`&&`和三元運算符(`condition ? expressionIfTrue : expressionIfFalse`)對渲染什麼和何時渲染做出有條件的判定。 然而,還有一個重要的話題需要討論,將這些概念中的任何一個或所有概念與另一個強大的 React 功能 props 結合起來。 使用 props 有條件地渲染代碼在 React 開發人員中很常見——也就是說:他們使用給定 prop 的值來自動決定渲染什麼。 +到目前爲止,你已經瞭解瞭如何使用 `if/else`、`&&` 和三元運算符(`condition ? expressionIfTrue : expressionIfFalse`)來決定渲染什麼和何時渲染。 然而,還有一個重要的話題需要討論,它可以讓你將這些概念中的一個或所有與另一個強大的 React 特性結合起來:props。 使用 props 有條件地渲染代碼對於 React 開發人員來說非常常見——也就是說,他們使用給定 props 的值來自動決定要渲染什麼。 在這個挑戰中,將設置一個子組件來根據 props 做出渲染決定。 可以使用三元運算符,但是可以看到過去幾個挑戰中涵蓋的其他幾個概念在這種情況下可能同樣有用。 diff --git a/curriculum/challenges/chinese-traditional/07-scientific-computing-with-python/scientific-computing-with-python-projects/arithmetic-formatter.md b/curriculum/challenges/chinese-traditional/07-scientific-computing-with-python/scientific-computing-with-python-projects/arithmetic-formatter.md index 885d37f579..3e41aa1b71 100644 --- a/curriculum/challenges/chinese-traditional/07-scientific-computing-with-python/scientific-computing-with-python-projects/arithmetic-formatter.md +++ b/curriculum/challenges/chinese-traditional/07-scientific-computing-with-python/scientific-computing-with-python-projects/arithmetic-formatter.md @@ -8,21 +8,78 @@ dashedName: arithmetic-formatter # --description-- -創建一個函數,該函數接收屬一個字符串列表,每個字符串代表一個算數問題,並返回垂直並排排列的問題。 +你將[使用我們的 Replit 入門代碼來完成這個項目](https://replit.com/github/freeCodeCamp/boilerplate-arithmetic-formatter)。 -你可以[在 Replit 上查看整個項目的具體描述和初始代碼](https://replit.com/github/freeCodeCamp/boilerplate-arithmetic-formatter)。 +# --instructions-- -訪問此鏈接後,fork 這個項目。 當你根據 “README.md” 中的說明完成了項目,請在下方提交你的項目鏈接。 +小學生經常把算術題垂直排列,這樣更容易解決。 例如,“235 + 52” 變成: -我們仍在開發 Python 課程的交互式教學部分。 目前,freeCodeCamp.org YouTube 頻道上的一些視頻會教授你這個項目需要的所有技能。 +```py + 235 ++ 52 +----- +``` -