| English | 意味 |
|---|---|
| array/əˈreɪ/ | 配列 |
| index/ˈɪndeks/ | 添字 |
| nested/ˈnestɪd/ | 階層構造 |
| file handling/faɪl ˈhændlɪŋ/ | ファイル操作 |
配列とファイル
- 配列 は単一の変数に同じ型の多数の値を格納する。
- ファイル は、プログラム終了後もデータを保持させることができる。
- ループはこれら両方を処理する自然な方法である。
一次元配列
- 1D配列 は単一のリストのようなもので、各値はインデックス(位置番号)で見つかる。
DECLARE Scores : ARRAY[1:5] OF INTEGER
Scores[1] ← 90
FOR I ← 1 TO 5
INPUT Scores[I]
NEXT I
- ループを使って配列全体を埋めたり読み出したりする。

1D配列は単一の変数に多数の値を保持し、各値はインデックスで見つかります。
An array is:
難易度 1/5 · 100 コイン + 今日初回完了時に小ボーナス付与
An array stores many same-type values under one name; each is accessed by its index.
二次元配列
- 2D配列 は行と列を持つ表のようなもので、2つのインデックス
[row, column]を使用する。
DECLARE Grid : ARRAY[1:3, 1:3] OF INTEGER
Grid[2, 3] ← 8 // row 2, column 3
- 2D配列は、ループ内のループ(ネスト反復)を使って読み出す。

2D配列は表であり、各値は2つのインデックス(行, 列)で見つかります。
Index a 2-D array: Grid[Row, Col]
A 2-D array is a grid of values. Grid[Row, Col] reaches exactly one cell — the row first, then the column. Cambridge counts both from 1.
In grid[2, 3], which cell is accessed?
難易度 1/5 · 100 コイン + 今日初回完了時に小ボーナス付与
The first index is the row, the second the column — row 2, column 3.
Match each idea to what it means.
難易度 2/5 · 140 コイン + 今日初回完了時に小ボーナス付与
Arrays hold many values by index; a 2-D array is a grid; nested loops walk it; files are opened, used and closed.
ファイル操作
- プログラムはデータをファイルに格納することで、プログラム終了後も残せる。
- ファイルを開く、使う、そして閉じる:
OPENFILE "data.txt" FOR WRITE
WRITEFILE "data.txt", "Hello"
CLOSEFILE "data.txt"
- 完了したら必ずファイルを閉じる(
FOR READを使って再度読み出す)。

カウンタは1ずつ増やします;-totalは蓄積和を作ります
Put the steps of using a file in the correct order.
難易度 3/5 · 200 コイン + 今日初回完了時に小ボーナス付与
Always open first, then do the reading/writing, then close to save buffered data and free the file.
You should always close a file when you have finished using it.
難易度 1/5 · 100 コイン + 今日初回完了時に小ボーナス付与
Closing saves any buffered data and frees the file for other programs.
理解できましたか
- 1D配列 は1つのインデックスでアクセスできるリストであり、ループで埋めたり読み出したりする
- 2D配列 は
[row, column]でアクセスできる表であり、ネストループを使用する - ファイル操作: OPENFILE (READ/WRITE) → READFILE/WRITEFILE → CLOSEFILE
- 完了したら必ずファイルを閉じる