# ゲーム板の更新

ゲーム板の更新処理を実装します。

## ゲーム板の更新処理を考えよう

3 x 3の二次元配列に数値を配置するメソッドを実装しましょう

```ruby
# 説明: ゲーム板にコマを配置する
# 引数: board: ゲーム板, 3 x 3の二次元配列
#      player: プレイヤーを表す。1 or 2の数値
#      row: 更新する行番号
#      col: 更新する列番号
# 戻り値: なし
def place_piece board, player, row, col
end
```

{% hint style="info" %}
**課題コーナー**

place\_pieceメソッドを実装してみましょう
{% endhint %}

## ゲーム板の更新処理の実装

ゲーム板の更新処理を実装しましょう。

とても簡単。１行だけです。

```ruby
# 説明: ゲーム板にコマを配置する
# 引数: board: ゲーム板, 3 x 3の二次元配列
#      player: プレイヤーを表す。1 or 2の数値
#      row: 更新する行番号
#      col: 更新する列番号
# 戻り値: なし
def place_piece board, player, row, col
  board[row][col] = player
end
```

ゲーム板にコマを配置するメソッドが実装できました


---

# 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://kashiwara.gitbook.io/rubydesurufurusukuratchibe/rojikkuno/gmuno-1.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.
