> For the complete documentation index, see [llms.txt](https://cx.ryz.wtf/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cx.ryz.wtf/funktionen.md).

# Funktionen

## 📘 Dokumentation – Python-Funktionen in **gturtle**

***

## 🐢 Grundlegende Funktionen

### 🖥️ Fenster & Turtle

#### `makeTurtle()`

Erstellt eine neue Turtle.

```python
from gturtle import *

makeTurtle()
```

***

#### `hideTurtle()`

Versteckt die Turtle.

```python
hideTurtle()
```

***

#### `showTurtle()`

Zeigt die Turtle wieder an.

```python
showTurtle()
```

***

#### `setPos(x, y)`

Setzt die Position der Turtle.

```python
setPos(100, 50)
```

***

#### `home()`

Geht zurück zur Startposition (0,0).

```python
home()
```

***

### ➡️ Bewegung

#### `forward(d)` oder `fd(d)`

Bewegt die Turtle um `d` Pixel vorwärts.

```python
fd(100)
```

***

#### `back(d)` oder `bk(d)`

Bewegt die Turtle rückwärts.

```python
bk(50)
```

***

#### `right(a)` oder `rt(a)`

Dreht die Turtle nach rechts um `a` Grad.

```python
rt(90)
```

***

#### `left(a)` oder `lt(a)`

Dreht die Turtle nach links um `a` Grad.

```python
lt(45)
```

***

### ✏️ Zeichnen

#### `penUp()` oder `pu()`

Hebt den Stift an (keine Linie).

```python
pu()
```

***

#### `penDown()` oder `pd()`

Setzt den Stift auf (zeichnet).

```python
pd()
```

***

#### `setPenWidth(w)`

Setzt die Stiftdicke.

```python
setPenWidth(3)
```

***

#### `setPenColor(color)`

Ändert die Stiftfarbe.

```python
setPenColor("red")
```

***

#### `clear()`

Löscht die Zeichnung.

```python
clear()
```

***

### 🎨 Füllfunktionen

#### `setFillColor(color)`

Setzt die Füllfarbe.

```python
setFillColor("blue")
```

***

#### `startPath()`

Beginnt eine Fläche.

```python
startPath()
```

***

#### `fillPath()`

Füllt die Fläche aus.

```python
fillPath()
```

***

## 🔁 Beispiel mit for-Schleife

### Quadrat zeichnen

```python
from gturtle import *

makeTurtle()

for i in range(4):
    fd(100)
    rt(90)
```

***

### Stern zeichnen

```python
from gturtle import *

makeTurtle()

for i in range(5):
    fd(150)
    rt(144)
```

***

## 🔢 range() Varianten

| Funktion          | Bedeutung     |
| ----------------- | ------------- |
| `range(5)`        | 0 bis 4       |
| `range(1, 6)`     | 1 bis 5       |
| `range(0, 10, 2)` | 0, 2, 4, 6, 8 |

***

## 📌 Zusammenfassung

* `fd()` bewegt vorwärts
* `rt()` dreht nach rechts
* `lt()` dreht nach links
* `pu()` / `pd()` steuern das Zeichnen
* `setPenColor()` ändert die Farbe
* `for i in range(n):` wiederholt Befehle


---

# 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://cx.ryz.wtf/funktionen.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.
