Interactive labs, coding challenges, code by games, and multiplayer simulations designed for future professionals from YUKTY

CodeArena — AI Tank Battle
CodeArena · AI Tank Battle
🟢 LIVE · Write a JS turn() function to control your tank. Both AIs fight a deterministic battle — same result on every screen.
Program your war machine

AI Tank Battle

Two tanks, opposite ends. Write the code that decides how yours moves, aims, and fires. Smartest strategy wins.

OR

Battle Lobby

ROOM CODE
----
OR OPEN LINK
Player 1
VS
waiting…
Player 2
Share the QR or code. Battle is 1v1 — needs exactly 2 players.
🏆

You100
Enemy100
turn(me, enemy, arena) runs every tick. Return an action object. Available: me.x me.y me.angle me.health · enemy.x enemy.y enemy.health enemy.dist enemy.bearing · arena.width arena.height
Return: { move:"forward"|"back"|"none", turn: degrees, aim: degrees(absolute), fire: true|false } — move speed & fire have cooldowns.
// write your turn() function, then submit
Scroll to Top