> For the complete documentation index, see [llms.txt](https://trg.gatcg.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trg.gatcg.com/player-communication/shortcuts/loops-and-iteration.md).

# Loops and Iteration

Loops are considered actions or a sequence of events that can occur an arbitrary amount of times, each iteration completed identically through that sequence of actions. players must demonstrate a loop exists by performing an action or sequence of actions that do not produce a conditional effect. If a sequence of actions results in the player being required to make a decision or where they intentionally make a choice, it is either not considered a loop or will stop being a loop at that point, if a player was demonstrating a loop previously. If a loop can be demonstrated to be “infinite,” the player must choose a number equal to how many times they wish to iterate through the loop. When this is done, that loop will iterate that many times; players cannot choose “infinity” as a number. If a loop depends on hidden information for continuity, a judge may be called to determine the continuity of the loop. Loops must be deterministic, i.e., the outcome of the loop must produce the same effects for each iteration in the loop.&#x20;

Loops must be able to progress the state of the game. If a loop or series of iterations in a loop does not produce a meaningful progression of the game state, a judge may rule that the player must take different actions.&#x20;

{% hint style="info" %}
E.g. If an arbitrary n iterations of a loop does not change the game state from the current state to the state after the iterations are completed, it is not considered to be meaningful.
{% endhint %}

{% hint style="info" %}
Shortcut example using iteration or looping:

* Drawing n cards using a champion’s ability to remove 3 enlighten counters to draw a card. 3n counters will be removed and the player will draw n cards after concluding the loop.
  {% endhint %}


---

# 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, and the optional `goal` query parameter:

```
GET https://trg.gatcg.com/player-communication/shortcuts/loops-and-iteration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
