# NIM

## Introduction

NIM is a solvable game! The goal is for students to play and develop a strategy that will allow them to win the game every time.

Suggested Method of teaching 1. Place students into groups of 3. 2. Allow each group to practice with their partners for 10 minutes to see if they can create a strategy to play 3. Then have groups play each other for 10 minutes. (rotate the groups so everyone can play each other) 4. When finished, discuss strategies that the groups came up with. There should be one that guarantees a win every time

Here is the board set up. You can use chips or cards for each circle

### Version 1

O O O O O&#x20;

O O O O&#x20;

O O O

### Version 2

O O O O O O O O O O O O O O O O O&#x20;

Game Rules 1. Players will alternate turns. (Best to flip a coin to see who goes first) 2. On each turn you must take at least one piece from the board. You may take more than one. 3. You can only remove pieces from one row on your turn. For example, I may choose to take all five from the top row. (With this move I have fulfilled rule 2 and 3) 4. The winner is the player who takes the last piece off of the board


---

# 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://www.pythonclassroom.com/python-curriculum-map/pedagogy/activities/nim.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.
