Play | Rules | Spec | Links

Here is the exact game loop. If you want to re-implement or port the game, this can be used as reference.

stamina1 ← 600 stamina2 ← 600 loop until (stamina1 equals zero) and (stamina2 equals zero) : force1 ← get from bot1 force2 ← get from bot2 force1 ← truncate(force1) force2 ← truncate(force2) force1 ← maximum(1,force1) force2 ← maximum(1,force2) force1 ← minimum(stamina1,force1) force2 ← minimum(stamina2,force2) if (force2 equals zero) : force1 ← 1 if (force1 equals zero) : force2 ← 1 if (force1 equals force2) : stamina1 ← stamina1 - 1 stamina2 ← stamina2 - 1 else : stamina1 ← stamina1 - force1 stamina2 ← stamina2 - force2 if (force1 greater than force2) : stamina1 ← stamina1 + 1 bot1 wins ball if (force2 greater than force1) : stamina2 ← stamina2 + 1 bot2 wins ball

State transitions:


    winner      loser               winner      loser       winner      loser
    point       point               point       point       game        game
    
    Love        Love        →       15          Love        .           .
    Love        15          →       15          15          .           .
    Love        30          →       15          30          .           .
    Love        40          →       15          40          .           .
    15          Love        →       30          Love        .           .
    15          15          →       30          15          .           .
    15          30          →       30          30          .           .
    15          40          →       30          40          .           .
    30          Love        →       40          Love        .           .
    30          15          →       40          15          .           .
    30          30          →       40          30          .           .
    30          40          →       Deuce       Deuce       .           .
    40          Love        →       Love        Love        +1          .
    40          15          →       Love        Love        +1          .
    40          30          →       Love        Love        +1          .
    Deuce       Deuce       →       Advantage   -           .           .
    -           Advantage   →       Deuce       Deuce       .           .
    Advantage   -           →       Love        Love        +1          .