Retrucada

I made 1-on-1 truco in a 3D corner bar, with a robot that doesn't cheat

Truco, the Brazilian card game, is a game of hidden information: half the fun is what you don't know. At a bar table nobody sees the other hand. In a computer game, getting that right takes more work than it seems. Today I opened Retrucada, paulista and mineiro truco, 1 against 1, in a 3D corner bar, and I want to show how it works inside.

The game doesn't hand over your cards

The easy way to make an online card game is to send everything to your browser and just hide the opponent's hand on screen. Then anyone a little curious can peek.

In Retrucada, the server only sends each player what they would see at a real table: their own cards, the cards on the table, the calls and the score. The opponent's hand never leaves the server. And an automated test swaps the opponent's cards for others and checks that what you receive stays the same. If I ever leak something by accident, the test tells me.

A robot that plays without seeing your cards

The robot follows the same rule: it doesn't see your hand. So how does it play well?

It does what a good player does in their head, just many times over:

  1. It imagines 200 hands you could have, given everything it has seen (the cards played, the vira).
  2. If you called truco, it thinks a strong hand is a bit more likely. Only a bit, because you might be bluffing.
  3. For each of those imagined hands, it works out the best play as if all cards were face up.
  4. It plays the card that does best on average. To call or accept truco, it weighs its chance of winning against what's at stake, and gets more careful near 12 points.

And it bluffs now and then.

There are three levels. I had the robots play each other, 200 matches per pairing: in paulista, medium beats easy 74% of the time, and hard beats medium 66%. In mineiro the gap is smaller (66% and 58%), because the fixed manilhas leave more to luck.

How you know I didn't rig the shuffle

In matches that count for the rankings, the server deals the cards. But the server is me. How do you know I didn't pick the deck?

It's like leaving the answer in a sealed envelope before the game starts. At the start of the match, the server publishes a code that only matches that shuffle. At the end, it reveals the shuffle, and anyone can check that the code matches and replay the whole match, card by card. If I swapped the deck midway, the code would stop matching.

In the daily circuit, everyone gets the same cards, one try per day, and you can compare who went furthest. So nobody can peek at the cards early, the replay only comes out after the day ends.

The campaign

Besides the table, there's a campaign: you go through 9 bars in three neighborhoods, and the third bar in each is a boss. Every opponent has a quirk that changes a rule. Seu Zé always calls truco when he has a manilha. Dona Cida hides the vira. Juca never folds. Your first loss in each neighborhood goes on your tab, and you replay the same bar; the second ends the campaign. Finish all 9 and it's late night: endless bars, to see how far you go.

Between bars there's the shop, where you spend bottle caps on:

AIs at the table

You can also put an AI, like Claude, to play against the robot, against people or against other AIs. Each model has its own rating on the leaderboard. The AI gets exactly what you would get, so it doesn't see your hand either. I want to find out which one bluffs best.


You can play the robot without an account at retrucada.com. Feedback is very welcome, especially about the robot: does it bluff too much? Too little?

So, truco?