> For the complete documentation index, see [llms.txt](https://cellular-automata.gitbook.io/cellular-automata-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cellular-automata.gitbook.io/cellular-automata-documentation/chapter-4-implementation-guide/quickstart.md).

# Tools and Platforms

<figure><img src="/files/t1QXjFwZoUG90QJOODKf" alt=""><figcaption></figcaption></figure>

* **Frameworks**:
  * Python libraries like `matplotlib` and `numpy`.
  * AI libraries like OpenAI API.
* **Interactive Platforms**:
  * Integrate with web tools (e.g., React, D3.js).

#### Sample Code

* Basic Cellular Automata simulation:

```
import numpy as np
import matplotlib.pyplot as plt

# Initialize grid
grid = np.zeros((100, 100))
grid[50, 50] = 1  # Seed

# Define rules
def update(grid):
    new_grid = np.zeros(grid.shape)
    for x in range(1, grid.shape[0]-1):
        for y in range(1, grid.shape[1]-1):
            neighbors = grid[x-1:x+2, y-1:y+2].sum() - grid[x, y]
            if grid[x, y] == 1 and (neighbors == 2 or neighbors == 3):
                new_grid[x, y] = 1
            elif grid[x, y] == 0 and neighbors == 3:
                new_grid[x, y] = 1
    return new_grid

# Run simulation
for _ in range(100):
    grid = update(grid)
    plt.imshow(grid, cmap='binary')
    plt.pause(0.1)
```

#### Integrating AI

* Use AI to parse natural language prompts into CA rules:

```
from openai import ChatCompletion

prompt = "Create a rule where cells grow like a forest fire."
response = ChatCompletion.create(
    model="gpt-4",
    messages=[{"role": "user", "content": prompt}]
)
rules = response["choices"][0]["message"]["content"]
```

***

###


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://cellular-automata.gitbook.io/cellular-automata-documentation/chapter-4-implementation-guide/quickstart.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.
