Backgammon against the computer

Play backgammon against the computer at Easy, Medium or Hard, free and with no sign-up; the computer never sees future dice.

Game and rules

Pick the game mode first

Not sure? Stay with Tavla.

The rules are set

No need to change them. Press Next.

Who are you playing?

Playing a friend? You send them a link.

Send the link

Once your friend is in, you can start the game.

Drag a checker, or tap it and then the point it should go to.

Frequently asked questions

Does the computer cheat with the dice?

No. On this page the dice come from the cryptographic random generator in your browser (crypto.getRandomValues), the same one for you and the computer. The computer is given the position and the roll it has just made. It cannot see the next roll, because the next roll does not exist yet, and there is no code that favours either side.

How strong is the computer?

There are three levels. Easy is a beginner that usually picks one of its better moves and sometimes makes a clear mistake. Medium always plays the move its position score likes best. Hard plays out sample games from its best few moves and picks the one that wins most. Hard is clearly the strongest, but it is good practice rather than a world-class program, and a strong player should beat it over a long match.

Why does Easy sometimes play a really bad move?

On purpose. About once in twelve moves it picks any legal move at random, which can be a blunder. The rest of the time it picks one of the two moves it rates highest. Its mistakes leave openings, and learning to punish them is the point of the level.

Does the computer play the same move every time?

Medium does: it adds no randomness, so in the same position with the same roll it makes the same move. Easy chooses at random between its two best moves. Hard's sample games use random dice, so in a close decision it can now and then choose differently.

What does the computer look at when it judges a position?

In classic tavla and backgammon all three levels use the same hand-written score, built from things a player counts anyway: the pip count, how likely each blot is to be hit and how many pips that would cost, points made in the home board and the bar point, the longest row of made points, anchors in its opponent's home board, checkers on the bar (worse against a strong home board), heavy stacks, which it marks down, and checkers already off. Once the two sides can no longer touch each other, it switches to a race score: pips, checkers off and a small penalty for checkers still outside home. The variants without hitting, and Mahbusa with its pins, get a score of their own, since the classic one assumes hits and a bar. In Gülbahar, Hard goes further with a score only it uses, built around walls and the dice a side cannot play.

How does Hard choose its move?

It takes the three moves with the best quick score and plays each one forward in sample games with random dice, both sides playing the way Medium would, and counts the points won and lost. All three candidates get the same dice, so the comparison is fair. A blot that looks harmless to Medium but keeps getting hit in the sample games looks bad to Hard. It overrules its quick score only when the games clearly disagree, and because it tests only three moves it can miss a good move that its quick score did not like.

Why does Hard take longer to move?

In classic tavla it plays 128 short sample games for each of its best three moves, and in the variants fewer and shorter ones, because those games run longer. That work runs in the background of your browser, so the page stays responsive. On an older phone you may notice a short pause.

Will the computer double me?

Only if the doubling cube is on, and only at Medium and Hard. They offer a double when they rate their winning chance between 72 and 88 percent. Easy never doubles. The cube is off under the default tavla rules.

When does the computer accept a double?

Easy always takes. Medium and Hard take when they rate their chance at 25 percent or better, and drop otherwise. No level ever beavers, even with the beaver option on.

Does the computer think about the match score?

No. All three levels look at the current position only. They do not change their moves or cube decisions for the score, so at a late match score you may see a double a strong human would not make.

Does it learn from my games?

No. Its scoring is a fixed set of hand-written weights, and nothing about your games is used to change it. Every game it plays by the same logic.

Which level should I start with?

Medium is the default. If you are still learning how the checkers move, start on Easy and practise the basics: legal moves, entering from the bar, bearing off. Move to Medium once you win regularly, and work on making points and leaving fewer blots, because Medium never gives a game away. Go to Hard when Medium stops being a contest: it punishes loose play, and its weak spot is long plans such as primes, timing and when to run. Beating Hard over a match is a real sign of progress.

Does a level change my dice or the rules?

No. The level only changes how the computer chooses its moves. Rolls and rules are the same at every level, so your results at each level are a fair comparison of how you play against it.

Does the computer follow house rules such as no hit-and-run at home?

Yes. The computer only ever chooses from the legal moves under the rules you set in the Rules step, so a house rule binds it exactly as it binds you. With the doubling cube on, Medium and Hard also make their own cube decisions.

Can I play Gülbahar, Mahbusa or the other variants against the computer?

Yes. Pick the game in the Game mode step and the computer plays it at the level you chose. In kız tavlası the difficulty choice disappears, because the dice decide almost everything and the levels could not play differently.

Does the computer ever resign?

No. It plays every game to the last checker, unless the cube is on and it drops a double. You can resign yourself from the board menu.