Skip to content

Commit 5783f79

Browse files
committed
Revert "Merge branch 'master' of https://github.com/ut-code/utcode-learn"
This reverts commit 26f875d, reversing changes made to a745332.
1 parent 26f875d commit 5783f79

File tree

22 files changed

+37
-254
lines changed

22 files changed

+37
-254
lines changed

docs/1-trial-session/01-get-started/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import openFolderVideo from "./open-folder.mp4";
1010

1111
**Visual Studio Code** (以下 VS Code) は、Microsoft 社が開発するテキストエディタです。多くの開発者に使用されています。
1212

13-
Visual Studio Code は、[公式サイト](https://code.visualstudio.com/Download)からインストールできます。まだインストールが終わっていない場合はインストールしておきましょう。
13+
Visual Studio Code は、[公式サイト](https://code.visualstudio.com)からインストールできます。まだインストールが終わっていない場合はインストールしておきましょう。
1414

1515
<video src={installVscodeVideo} controls />
1616

docs/1-trial-session/08-loop/index.md

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ while (条件式) {
3939

4040
![while文の構造](./while-statement.drawio.svg)
4141

42-
### 確認問題
42+
### 課題
4343

4444
1 から 10 までの整数の合計を計算するプログラムを作ってみましょう。
4545

@@ -92,7 +92,7 @@ for (初期化; 条件式; 更新式) {
9292

9393
![for文の構造](./for-statement.drawio.svg)
9494

95-
### 確認問題
95+
### 課題
9696

9797
前項で書いた 1 から 10 までの整数の合計を計算するプログラムを for 文を用いて書き換えてみましょう。
9898

@@ -139,16 +139,7 @@ const string2 = `10から2を引くと${10 - 2}です。`;
139139

140140
:::
141141

142-
## 中級問題
143-
144-
ある整数値`integer`が与えられたとき、その値が素数であるかどうか判定するfor文を書いてみましょう。
145-
そして、`integer`に6,11,57,89を入れてテストしてみましょう。
146-
147-
:::info
148-
素数の定義は`1とその数以外の整数で割り切れない自然数`でしたね。
149-
`integer-2`個の<Term type="javascriptBoolean">真偽値</Term>の論理積 `&&` (AND) はどうやって評価すればよいでしょうか?
150-
151-
### 発展課題
142+
### 課題
152143

153144
HTML の `table`, `tr`, `td` タグを用いて、九九の表を画面に表示させてみましょう。
154145

docs/6-exercise/1-basis-of-web/_samples/bubble-sort/normal/index.html renamed to docs/1-trial-session/10-array/_samples/Array-class/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="ja">
33
<head>
44
<meta charset="utf-8" />
5-
<title>Bubble Sort</title>
5+
<title>Title</title>
66
</head>
77
<body>
88
<script src="./script.js"></script>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Array#push メソッドを用いて、フィボナッチ数列の配列を作成
2+
const f = [1, 1];
3+
for (let i = 0; i < 100; i += 1) {
4+
f.push(f[f.length - 1] + f[f.length - 2]);
5+
}
6+
7+
// 作成した配列の各要素を for ~ of 文を用いて出力
8+
for (const item of f) {
9+
document.write(item);
10+
}
11+
12+
// 作成した配列の各要素を、通常の for 文と Array#length プロパティを用いて出力
13+
for (let i = 0; i < f.length; i += 1) {
14+
document.write(f[i]);
15+
}

docs/1-trial-session/10-array/_samples/Array-fibonacci/index.html

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

docs/1-trial-session/10-array/_samples/Array-fibonacci/script.js

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

docs/1-trial-session/10-array/_samples/Array-printer/index.html

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

docs/1-trial-session/10-array/_samples/Array-printer/script.js

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

docs/1-trial-session/10-array/_samples/array/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="ja">
33
<head>
44
<meta charset="utf-8" />
5-
<title>配列 確認問題</title>
5+
<title>Title</title>
66
</head>
77
<body>
88
<script src="./script.js"></script>

docs/1-trial-session/10-array/index.md

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const six = 6;
4040
document.write(studentNames[six / 2 - 1]); // 鈴木
4141
```
4242

43-
### 確認問題
43+
### 課題
4444

4545
次のプログラムを実行すると何と表示されるでしょうか。
4646

@@ -93,7 +93,6 @@ document.write(studentNames.length); // 3
9393
studentNames.push("内藤");
9494
document.write(studentNames.length); // 4
9595
```
96-
9796
### `配列.push` 関数
9897

9998
`関数.push`関数 [(MDN)](https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Array/push)は、指定した配列の末尾に新しい値を追加する関数です。
@@ -104,32 +103,13 @@ studentNames.push("内藤");
104103
document.write(studentNames); // 田中,佐藤,鈴木,内藤
105104
```
106105

107-
## 基礎課題 連続表示
108-
109-
- 引数に与えられた配列の要素を順番に表示する関数を、通常のfor文を使って作ってみましょう。
110106

111-
:::tip ヒント
112-
引数でとった配列にも.length変数が存在します。
113-
最終項のインデックスは `配列の長さ-1` なので注意しましょう。
114-
:::
115-
<Answer>
116107

117-
```javascript
118-
function printArray(array) {
119-
for (let i = 0; i < array.length; i++) {
120-
document.write(array[i]);
121-
}
122-
}
123-
```
124-
125-
<ViewSource url={import.meta.url} path="_samples/Array-printer" />
126-
127-
</Answer>
128-
129-
### 中級課題 フィボナッチ数列
108+
### 課題
130109

131110
- `配列.push` 関数を用いて、フィボナッチ数列の配列を作ってみましょう。
132111
- 作成した配列の各要素を `for ~ of` 文を用いて出力してみましょう。
112+
- 作成した配列の各要素を、通常の `for` 文と `配列.length` 変数を用いて出力してみましょう。
133113

134114
:::info ヒント
135115

@@ -149,15 +129,17 @@ for (let i = 0; i < 100; i += 1) {
149129
for (const item of f) {
150130
document.write(item);
151131
}
132+
// 作成した配列の各要素を、通常の for 文と f.length 変数を用いて出力
133+
for (let i = 0; i < f.length; i += 1) {
134+
document.write(f[i]);
135+
}
152136
```
153137

154-
<ViewSource url={import.meta.url} path="_samples/Array-fibonacci" />
138+
<ViewSource url={import.meta.url} path="_samples/Array-class" />
155139

156140
</Answer>
157141

158-
## [発展課題 バブルソート](../../6-exercise/1-basis-of-web/index.md/#バブルソート)
159-
160-
<!-- オブジェクトはまだ扱っていないためコメントアウト、オブジェクトの節にtipとして移動も可
142+
<!-- オブジェクトはまだ扱っていないためコメントアウト
161143
## 配列とオブジェクト
162144
163145
配列はオブジェクトの一種です。しかしながら、JavaScript のオブジェクトとは、[オブジェクトの節](../../1-trial-session/11-object/index.md)で扱ったように、プロパティ名とプロパティ値の組み合わせでした。
@@ -186,4 +168,4 @@ document.write(studentNames["0"]); // 田中
186168
```
187169
188170
:::
189-
-->
171+
-->

0 commit comments

Comments
 (0)