The Editor (Python)

The Editor

> Tutorial

The editor, which you can reach through the “Editor” tab in the menu, is where you develop your AI.

What is an AI?

An Artificial intelligence (AI) is a piece of code, written here in Python, that controls your leek during its turn. The code you write runs at the start of each of your leek's turns and controls the actions it performs: attacking, moving, using a weapon or a chip…

Here is a very simple example of an AI:

Once a fight has started, you can no longer step in to control your protégé's actions: only the AI counts, which is why it's essential to program it carefully.

Your AI runs in a standard Python engine (3.12). Fight functions are called as methods, for example me.moveToward(enemy).

The editor interface

The editor lets you create and edit your AIs. Once your code is written, save it with the File > Save button or the Ctrl + S shortcut. When you save, any errors detected by the editor are shown in red.

The editor also has many keyboard shortcuts that can save you time while developing your AIs. Here are the most useful ones to get started:

❓ Quiz

What can you do with the editor?

Develop an AI Test an AI Publish an AI View an AI