TrainingBox V2 – Debug
Teste localement, puis publie en ligne
Map (debug local)
Mode DEBUG – bot local
La carte globale est sur index.html.
Code du bot (JS)
Fonction obligatoire : function botTurn(api)
API : moveForward, turnLeft, turnRight, detectObstacle, spy, log
Aide API

🤖 Aide – API du bot

Ton bot est contrôlé par une fonction :

function botTurn(api) { }

⏱️ Règle importante

⚠️ Une seule action est autorisée par tour.


➡️ Avancer

api.moveForward();

↩️ Tourner à gauche

api.turnLeft();

↪️ Tourner à droite

api.turnRight();

❓ Détecter un obstacle

api.detectObstacle();

👁️ Infos du bot

api.spy();

📝 Afficher un message

api.log("Hello");

✅ Exemple simple

function botTurn(api) {
  if (api.detectObstacle()) {
    api.turnRight();
  } else {
    api.moveForward();
  }
}
  
Mon bot
Console
Astuce : publie souvent. Tes modifications sont visibles par tout le monde.