> For the complete documentation index, see [llms.txt](https://volki.gitbook.io/git-started/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://volki.gitbook.io/git-started/play/hangman.md).

# Hangman

{% hint style="info" %}

#### Learn [Hangman rules](https://www.wikihow.com/Play-Hangman).

{% 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/Hangman/YourName vs OpponentsName"
  $ cp -i "Games/Multiplayer/Hangman.md" "Playground/Multiplayer/Hangman/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
  # Makes up a word and updates the "_" characters then saves the file
  $ git add .
  $ git commit -a -m "Gamemaster Turn Number"
  $ git push -u origin Game-Session
  ```
* **Second players FIRST turn:**

  ```bash
  $ git checkout -b Game-Session
  $ git pull origin Game-Session
  # Takes a guess by writing down a letter next to "Guessed by now: " then saves the file
  $ git add .
  $ git commit -a -m "Guesser 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 "Gamemaster/Guesser Turn Number"
  $ git push -u origin Game-Session
  ```

## FULL EXAMPLE:

* Joseph (gamemaster) and Mathew (guesser) are playing against each other their first game.

  ```bash
  git checkout -b Game-Session
  mkdir "Playground/Multiplayer/Hangman/Joseph vs Mathew"
  cp -i "Games/Multiplayer/Hangman.md" "Playground/Multiplayer/Hangman/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
  # Opens the "Game 1.md" with a text editor.
  # Makes up a word "Horse", overwrites "_ _ _ _ _" into the file and saves.
  $ git add .
  $ git commit -a -m "Gamemaster 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.
  # Guesses letter "H" so he writes down "Guessed by now: H" and saves.
  $ git add .
  $ git commit -a -m "Guesser 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.
  # Mathew guessed right so Joseph now updates "H _ _ _ _" and saves.
  $ git add .
  $ git commit -a -m "Gamemaster 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.
  # Guesses letter "M" so he writes down "Guessed by now: H M" and saves.
  $ git add .
  $ git commit -a -m "Guesser Turn 2"
  $ git push -u origin Game-session
  ```
* And so on.
