# Tic Tac Toe

{% hint style="info" %}

#### Learn [Tic Tac Toe rules](https://www.exploratorium.edu/brain_explorer/tictactoe.html).

{% endhint %}

## Make a Game Session

* Navigate Git Bash terminal into your Git-Started folder.
* Write commands:

  ```bash
  $ git checkout -b Game-Session
  $ mkdir "Playground/Multiplayer/TicTacToe/YourName vs OpponentsName"
  $ cp -i "Games/Multiplayer/TicTacToe.md" "Playground/Multiplayer/TicTacToe/YourName vs OpponentsName/Game Number.md"
  $ git add .
  $ git commit -a -m "Game start"
  $ git push -u origin Game-Session
  ```

## Play the Game

* Navigate through the Playground folder and find your *Game Number.md* file.
* Open the file by right-clicking and choosing to open with a text editor. I highly recommend [Notepad++](https://notepad-plus-plus.org/) for this purpose.
* **First players FIRST turn:**

  ```bash
  $ git checkout Game-Session
  # Places X and saves the file
  $ git add .
  $ git commit -a -m "Cross Turn Number"
  $ git push -u origin Game-Session
  ```
* **Second players FIRST turn:**

  ```bash
  $ git checkout -b Game-Session
  $ git pull origin Game-Session
  # Places O and saves the file
  $ git add .
  $ git commit -a -m "Circle Turn Number"
  $ git push -u origin Game-session
  ```
* **Other turns:**

  ```bash
  $ git checkout Game-Session
  $ git pull origin Game-Session
  # Takes a turn and saves the file
  $ git add .
  $ git commit -a -m "Cross/Circle Turn Number"
  $ git push -u origin Game-Session
  ```

## FULL EXAMPLE:

* Joseph (cross) and Mathew (circle) are playing against each other their first game.

  ```bash
  $ git checkout -b Game-Session
  $ mkdir "Playground/Multiplayer/TicTacToe/Joseph vs Mathew"
  $ cp -i "Games/Multiplayer/TicTacToe.md" "Playground/Multiplayer/TicTacToe/Joseph vs Mathew/Game 1.md"
  $ git add .
  $ git commit -a -m "Game start"
  $ git push -u origin Game-Session
  ```
* Josephs FIRST turn:

  ```bash
  $ git checkout Game-Session
  # Josephs opens the "Game 1.md" with a text editor.
  # Places X and saves.
  $ git add .
  $ git commit -a -m "Cross Turn 1"
  $ git push -u origin Game-session
  ```
* Mathews FIRST turn:

  ```bash
  $ git checkout -b Game-Session
  $ git pull origin Game-Session
  # Opens the "Game 1.md" file in a text editor.
  # Places O and saves.
  $ git add .
  $ git commit -a -m "Circle Turn 1"
  $ git push -u origin Game-session
  ```
* Josephs SECOND turn:

  ```bash
  $ git checkout Game-Session
  $ git pull origin Game-Session
  # Opens the "Game 1.md" file in a text editor.
  # Places X and saves.
  $ git add .
  $ git commit -a -m "Cross Turn 2"
  $ git push -u origin Game-session
  ```
* Mathews SECOND turn:

  ```bash
  $ git checkout Game-Session
  $ git pull origin Game-Session
  # Opens the "Game 1.md" file in a text editor.
  # Places O and saves.
  $ git add .
  $ git commit -a -m "Circle Turn 2"
  $ git push -u origin Game-session
  ```
* And so on.


---

# 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://volki.gitbook.io/git-started/play/tic-tac-toe.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.
