> Leek Wars
Leek Wars is a free online programming game played in the web browser. You don't control your character with the mouse: you write the program that makes it fight. Your leek battles other players' leeks in turn-based fights, and it acts only according to the artificial intelligence (AI) you coded for it.
1. Create a leek and pick its equipment: weapons, chips, characteristics. 2. Write its AI in the in-browser editor: move, aim, heal, choose a target… 3. Start fights in the garden, in tournaments or against bosses. Fights play out on their own, and you watch them afterwards to see what worked. 4. Improve your code, and your leek climbs the levels and the rankings.
A first AI fits in a few lines. It is the one every new leek starts with:
if (getWeapon() != WEAPON_PISTOL) {
setWeapon(WEAPON_PISTOL) // take the pistol in hand
}
var enemy = getNearestEnemy() // the nearest enemy
moveToward(enemy) // move closer
useWeapon(enemy) // and shoot
The same in Python:
me = Fight.me
if me.weapon != Weapon.pistol:
me.setWeapon(Weapon.pistol)
enemy = Fight.getNearestEnemy()
me.moveToward(enemy)
me.useWeapon(enemy)
You write your AI in LeekScript, the game's own language, easy to learn and designed for beginners, or in Python, JavaScript or TypeScript. Each language has its tutorial: LeekScript Tutorial, Tutorial (Python), Tutorial (JavaScript). Every function is described in the documentation.
Leek Wars is a way to learn programming through a game: variables, conditions, loops, functions, then pathfinding, damage calculations and strategy. You see the result right away in the fight, which makes you want to fix your code and try again. Nothing to install: the editor, test fights and help are all in the browser.
Teachers can create a free private group for their class: accounts without e-mail addresses, imposed equipment, private tournaments.
The challenge grows fast: 301 levels, 31 weapons, 99 chips and components to craft, daily solo, farmer, team and battle royale tournaments, and a global ranking. The best AIs compute paths, anticipate their opponents and optimise every action point. The fight engine and the LeekScript compiler are open source on GitHub.
Impossible de charger les données du jeu.
Vérifiez votre connexion et réessayez.