# Verschachtelte Schleifen

Als Beispiel möchte ich mit Dir mal ein Haus mit Robokröti bauen. Fangen wir ganz einfach mit einer Basis-Wand an:

![Einmal hochfliegen und 6 Blöcke setzen](/files/-MXBj1XWXmS7dGkgQ_d3)

![Die erste Mauer steht!](/files/-MXBjJSZoY80Kb-SDtwj)

Unser Haus soll ja 4 Wände haben. Wie macht man das nun am besten? Man könnte die Programmierung oben einfach 4 mal wiederholen - aber das ist natürlich langweilig :-)

![](/files/-MXBj_yV5GRhIgBmMe5y)

![](/files/-MXBjq8u5IKrl8RP_jhR)

Erste Ebene unseres Hauses ist fertig! Aber das haus soll ja höher werden. Jetzt machen wir um unsere beiden bestehenden Schleifen außen rum noch eine weitere Schleife, die das so oft wiederholt, wie hoch das Haus sein soll. In meinem Fall will ich mein Haus 10 Blöcke hoch haben:

![](/files/-MXBk99Goku0s71l7L_v)

![](/files/-MXBk5fOlP4GyKnRfd-g)

{% hint style="success" %}
Unser Haus steht!
{% endhint %}

{% hint style="warning" %}
Pro Ebene brauchen wir also 4 x 6 Blöcke = 24 Blöcke. Wenn wir nun unser Haus 10 Blöcke hoch machen wollen, brauchen wir 240 Blöcke - nach 64 bekommst du eine Fehlermeldung - wie Du das beheben kannst, ist hier erklärt:&#x20;
{% endhint %}


---

# 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://handbuch.kidslab.de/minecraft/schleifen/verschachtelte-schleifen.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.
