LeetKO Play free

1v1 Python coding fights

Code fast. Hit hard.

LeetKO is a free fighting game where you attack by writing Python. Two players get the same coding challenge, and every line of working code you type lands a hit on your opponent's mech. Knock them out, or pass all four tests to win the round.

A LeetKO match: two mechs fight above a Python editor where a player is writing a has_duplicate function, with a 6-hit combo on screen.

How a fight works

  1. Find an opponent. Press Find match to fight another player, or create a private match and send the room code to a friend.
  2. Pick the challenge. One player is chosen at random to lock in a coding challenge, or roll a random one. Both fighters get the same problem.
  3. Type Python to attack. Each time a line becomes valid, complete code, it lands as a hit. Bigger structures hit harder.
  4. Win the round. Bring your opponent from 1000 HP to zero, or make your solution pass all four test cases.
The versus screen: two mechs face off before the challenge Repeated Value Check.

Controls

Type Python
Attack
Ctrl hold
Guard
Ctrl + Enter
Special, when the meter reads READY
↑ ↓ ← →
Block an incoming special
Finisher (Run Test)
Run the tests right away

The rules

Attack by typing

An expression, a statement, an assignment, or a block header such as for or def each count as a hit once the line is valid. Repeating the same shape of line loses power, and comments, pass, and lines that only print do no damage.

Build a combo

Every hit adds to your combo. Hits 3, 6, and 9 raise the bonus to +1, +2, and +3 damage, and 9 hits is MAX COMBO. Pressing Enter on a broken line resets it.

Guard and stamina

Hold Ctrl to guard. You can't type while guarding, and blocked hits drain your 100 stamina instead of HP. At zero stamina your guard breaks: you're stunned for 3.5 seconds and take 1.5× damage.

Specials

Dealing and taking damage fills your special meter. When it's full, press Ctrl+Enter. Your opponent has 2 seconds to press four arrow keys in order, or up to 200 damage gets through.

Finisher

Your code runs against four test cases as you type. Passing all four wins the round on the spot, so a clean solution beats a long brawl.

Fair play

There is no typing speed limit, so type as fast as you can. Paste is blocked: the code has to come from your keyboard.

An incoming special: the defender must press up, left, down, right in order to block it.

Ways to play

Play online

Find match pairs you with another player. Private match gives you a room code to share with a friend. After each round, both players can vote for a rematch.

Training

Pick any challenge and practice on a dummy that doesn't fight back. It's the best way to learn the controls and warm up before an online fight.

150 coding challenges

The challenges cover the classic coding interview topics at Easy, Medium, and Hard difficulty, each written for LeetKO with its own tests:

Questions

Is LeetKO free?
Yes. Every mode and every challenge is free.
Do I need an account?
Yes, a free account keeps your username, fight history, and friends. Sign up with an email address or continue with Google. You must be 13 or older.
What do I need to play?
A modern browser and a physical keyboard. Python runs right in your browser, so there is nothing to install.
Can my opponent see my code?
No. Your opponent sees your attacks, not your code.
Is there a ranking?
No. Matches are unranked and count toward the fight history on your profile.

Ready to fight?

Play LeetKO free