Skip to content

Commit e0dd4fd

Browse files
Merge pull request #294 from ut-code/develop
2023年5月1日までの微修正
2 parents d5b77a6 + c2c6fab commit e0dd4fd

File tree

17 files changed

+56
-60
lines changed

17 files changed

+56
-60
lines changed

.github/actions/build/action.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

.github/actions/install-modules/action.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/build-test.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
---
21
name: Build Test
32

43
on:
@@ -12,5 +11,16 @@ jobs:
1211
- name: Checkout Code
1312
uses: actions/checkout@v3
1413

14+
- name: Setup Node.js
15+
uses: actions/setup-node@v3
16+
with:
17+
node-version: latest
18+
cache: npm
19+
20+
- name: Install Dependencies
21+
run: npm ci
22+
shell: bash
23+
1524
- name: Build
16-
uses: ./.github/actions/build
25+
run: npm run build
26+
shell: bash

docs/6-exercise/1-basis-of-web/_samples/fibonacci/array/script.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
function fibonacci(n) {
22
let sequence = [0, 1];
3-
if (n === 0 || n === 1) {
4-
return sequence[n];
5-
}
63
for (let i = 2; i < n + 1; i += 1) {
74
sequence.push(sequence[i - 1] + sequence[i - 2]);
85
}

docs/6-exercise/1-basis-of-web/_samples/length-of-name/script.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
let lengthOfName = 7;
2-
if (4 <= lengthOfName && lengthOfName <= 10) {
1+
let nameLength = 7;
2+
if (4 <= nameLength && nameLength <= 10) {
33
// 比較演算子を2つ並べるのではなく、論理演算子&&を用います。
44
document.write("登録できます");
5-
} else if (lengthOfName === 0) {
5+
} else if (nameLength === 0) {
66
// else if の else が抜けていました。
77
document.write("名前を入力してください");
88
} else {

docs/6-exercise/1-basis-of-web/index.md

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar_position: 1
66
import Answer from "@site/src/components/Answer";
77
import ViewSource from "@site/src/components/ViewSource";
88

9-
この章では教材の「初めてのウェブ開発」から「ウェブサイトの見た目を整える」までの内容を扱っています。
9+
この章では教材の「[初めてのウェブ開発](../../1-trial-session/01-get-started/index.md)」から「[ウェブサイトの見た目を整える](../../1-trial-session/09-css/index.md)」までの内容を扱っています。
1010

1111
---
1212

@@ -81,11 +81,11 @@ HTML を用いて次のようなウェブサイトを作ってみましょう。
8181
と表示されるプログラムを以下のように作成しました。
8282

8383
```javascript
84-
let lengthOfName = 7;
85-
if (4 <= lengthOfName <= 10) {
84+
let nameLength = 7;
85+
if (4 <= nameLength <= 10) {
8686
document.write("登録できます");
8787
}
88-
if (lengthOfName === 0) {
88+
if (nameLength === 0) {
8989
document.write("名前を入力してください");
9090
} else {
9191
document.write("名前は4文字以上10文字以下で入力してください");
@@ -99,11 +99,11 @@ if (lengthOfName === 0) {
9999
<Answer>
100100

101101
```javascript
102-
let lengthOfName = 7;
103-
if (4 <= lengthOfName && lengthOfName <= 10) {
102+
let nameLength = 7;
103+
if (4 <= nameLength && nameLength <= 10) {
104104
// 比較演算子を2つ並べるのではなく、論理演算子&&を用います。
105105
document.write("登録できます");
106-
} else if (lengthOfName === 0) {
106+
} else if (nameLength === 0) {
107107
// else if の else が抜けていました。
108108
document.write("名前を入力してください");
109109
} else {
@@ -119,7 +119,7 @@ if (4 <= lengthOfName && lengthOfName <= 10) {
119119

120120
## 3. ブラックジャック
121121

122-
田中さんと佐藤さんの 2 人が、トランプゲームのブラックジャックで遊んでいます。ブラックジャックのルールは以下の通りとします
122+
田中さんと佐藤さんの 2 人が、トランプゲームのブラックジャックで遊んでいます。ブラックジャックのルールは次の通りとします
123123

124124
- 2 人の手札の数字の合計を比べ、より大きい方が勝ちとなる。
125125
- ただし、どちらか 1 人の手札の数字の合計が 21 を超えていた場合、その人の負けとなる。
@@ -156,15 +156,15 @@ if (tanakaHandTotal > satoHandTotal) {
156156

157157
## 4. フィボナッチ数列
158158

159-
(1)引数を 2 つとり、そのうち大きい数を返す関数 max を定義してください。
159+
1. 引数を 2 つとり、そのうち大きい数を返す関数 `max` を定義してください。
160160

161-
(2)1,1,2,3,5...というように、前 2 つの数を足すと次の数になるような数の並びをフィボナッチ数列と言います。引数 n に対してフィボナッチ数列の n 番目の数を返す関数を定義してください。ただし 1 番目と 2 番目の数は 1 とします。
161+
2. 1,1,2,3,5...というように、前 2 つの数を足すと次の数になるような数の並びをフィボナッチ数列と言います。引数 `n` に対してフィボナッチ数列の n 番目の数を返す関数を定義してください。ただし 1 番目と 2 番目の数は 1 とします。
162162

163163
### 解答例
164164

165165
<Answer>
166166

167-
(1)解答例
167+
1 の解答例
168168

169169
```javascript
170170
function max(a, b) {
@@ -177,7 +177,7 @@ function max(a, b) {
177177

178178
<ViewSource url={import.meta.url} path="_samples/max" />
179179

180-
(2)解答例
180+
2 の解答例
181181

182182
```javascript
183183
function fibonacci(n) {
@@ -192,16 +192,13 @@ function fibonacci(n) {
192192

193193
<ViewSource url={import.meta.url} path="_samples/fibonacci/recursion" />
194194

195-
(2)別解
195+
2 の別解
196196

197197
もし「配列」「繰り返し」という概念をすでに学習している場合、次のような書き方もできます。
198198

199199
```javascript
200200
function fibonacci(n) {
201201
let sequence = [0, 1];
202-
if (n === 0 || n === 1) {
203-
return sequence[n];
204-
}
205202
for (let i = 2; i < n + 1; i += 1) {
206203
sequence.push(sequence[i - 1] + sequence[i - 2]);
207204
}
@@ -229,7 +226,7 @@ function fibonacci(n) {
229226
- 出発できる場合には「出発できます」
230227
- 箱が多すぎる場合には「箱の数を減らしてください」
231228
- 重量が大きすぎる場合には「重量を減らしてください」
232-
- 箱も多すぎるし、重量も重すぎる場合には「箱の数と重量を減らしてください」
229+
- 箱が多すぎかつ重量も重すぎる場合には「箱の数と重量を減らしてください」
233230

234231
と表示されるプログラムを作ってみましょう。
235232

docs/6-exercise/10-typescript/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar_position: 9
66
import Answer from "@site/src/components/Answer";
77
import ViewSource from "@site/src/components/ViewSource";
88

9-
この章では教材の「TypeScript」の内容を扱っています。
9+
この章では教材の「[TypeScript](../../4-advanced/03-typescript/index.md)」の内容を扱っています。
1010

1111
---
1212

docs/6-exercise/11-react/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ sidebar_position: 10
66
import todoAppVideo from "./todo-app.mp4"
77
import ViewSource from "@site/src/components/ViewSource";
88

9+
この章では教材の「[React](../../4-advanced/04-react/index.md)」の内容を扱っています。
10+
11+
---
912
## ToDo リスト
1013

1114
以下のような本格的な ToDo リストを作ってみましょう。

docs/6-exercise/2-easy-apps/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import calculatorVideo from "./calculator.mp4";
1010
import objectEventVideo from "./object-event.mp4";
1111
import drawingVideo from "./drawing.mp4";
1212

13+
この章では教材の「[オブジェクト](../../1-trial-session/10-object/index.md)」から「[プロジェクト](../../1-trial-session/13-project/index.md)」までの内容を扱っています。
14+
1315
---
1416

1517
## 1. BMI 計算アプリ

docs/6-exercise/3-javascript/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ sidebar_position: 3
66
import Answer from "@site/src/components/Answer";
77
import ViewSource from "@site/src/components/ViewSource";
88

9+
この章では教材の「[ブラウザの開発者ツール](../../2-browser-apps/01-inspector/index.md)」から「[無名関数](../../2-browser-apps/06-anonymous-function/index.md)」までの内容を扱っています。
10+
911
---
1012

1113
## 1. コラッツの問題

0 commit comments

Comments
 (0)