# Dots and Boxes

{% hint style="info" %}
#### Learn [Dots and Boxes rules](http://www.papg.com/show?1TMU).
{% 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/DotsAndBoxes/YourName vs OpponentsName"
    $ cp -i "Games/Multiplayer/DotsAndBoxes.md" "Playground/Multiplayer/DotsAndBoxes/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
    # Draws a doted line and saves the file
    $ git add .
    $ git commit -a -m "Doted Turn Number"
    $ git push -u origin Game-Session
    ```
*   **Second players FIRST turn:**

    ```bash
    $ git checkout -b Game-Session
    $ git pull origin Game-Session
    # Draws a line and saves the file
    $ git add .
    $ git commit -a -m "Lined 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 "Doted/Lined Turn Number"
    $ git push -u origin Game-Session
    ```

## FULL EXAMPLE:

*   Joseph (doted) and Mathew (line) are playing against each other their first game.

    ```bash
    $ git checkout -b Game-Session
    $ mkdir "Playground/Multiplayer/DotsAndBoxes/Joseph vs Mathew"
    $ cp -i "Games/Multiplayer/DotsAndBoxes.md" "Playground/Multiplayer/DotsAndBoxes/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.
    # "Draws" a doted line and saves
    $ git add .
    $ git commit -a -m "Doted 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.
    # "Draws" a line and saves
    $ git add .
    $ git commit -a -m "Lined 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.
    # "Draws" a doted line and saves
    $ git add .
    $ git commit -a -m "Doted 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.
    # "Draws" a line and saves
    $ git add .
    $ git commit -a -m "Lined Turn 2"
    $ git push -u origin Game-session
    ```
* And so on.
