# フィールドの状態を記述する

<https://scratch.mit.edu/projects/83255528>

作成したでフィールドの四角形に色を塗れるようにします。

まずは、作成フィールドに番号を番号をふります。

![](/files/-LAM191Qy6QoVhv4u9b8)

## (1) Listにフィールドの状態を記録する

「フィールドの状態リスト」を作りに、降った番号に「枠あり」、「空」、「それ以外」の値を指定できるようにします。

![](/files/-LAM191fHBFG3_LNT0Ly)

ここでは、「空」を指定しています。

## (2) Listから値を取得と設定をする

フィールドの状態をXY座標を指定して設定できるようにします。

![](/files/-LAM192-iqaLkToUWp8c)

![](/files/-LAM192HiyKbKzgY9cok)

![](/files/-LAM192mJkmZVy-cm-8K)

## (3) 記録した状態に応じて、色を変える。

フィールドの状態に応じて四角形の色を変更できるようにします。

![](/files/-LAM193CcnHLpP39CFui)

## (4) 確認する

フィールドに値を設定できるようになったか確認してみしょう。

<https://scratch.mit.edu/projects/83255528>

![](/files/-LAM193t7hixTVj-yK5W)

### (4-1) 以下のスクリプトを追加する

![](/files/-LAM194c-mSuFn4Qkq7r)

### (4-2) 右上(みぎうえ)の緑色(みどりいろ)の旗(はた)をクリックする。

### (4-3) フィールド上の一つの四角形が茶色になっていれば成功です。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://firefirebook.firefirestyle.net/tetris/create_board_state.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
