include(string ai)
Includes the AI located at the path ai in the current AI.
Be careful: the include function must only be called in the main block, and its parameter must be a string written directly in the code.
For example, with a file tree like this one, and from inside the file myAI/main:
- (folder) myAI
|- main
|- utils
|- (folder) myFolder
|- (folder) other
|- functions
- (folder) strategy
|- attack
|- defense
- (folder) data
|- items
utils and functions):include("utils")
include("myFolder/other/functions")
import * as utils from "./utils.js"
import * as functions from "./myFolder/other/functions.js"
import utils
from myFolder.other import functions
attack):include("../strategy/attack")
import * as attack from "../strategy/attack.js"
# Python looks for modules in the AI's folder, then at the root
from strategy import attack
items):include("/data/items")
// No leading /: without ./ or ../, the path is looked up in the AI's folder, then at the root
import * as items from "data/items.js"
from data import items
import, require
include does not exist: the AI is split into modules with import / export. Only exported names (export function …) are visible from other files. See JavaScript and TypeScript.
include does not exist: the AI is split into modules with import, as in regular Python. A module is looked up in the AI's folder, then at the root. See Python.
Impossible de charger les données du jeu.
Vérifiez votre connexion et réessayez.