Inspiration
We came across ChessFly, a project that taught a chess-playing model built on the wiring of a real fruit fly’s brain, and wondered what a fly brain would do with poker instead. Poker felt like a better test than chess: it’s about bluffing, reading opponents and handling risk, not just calculating moves. Once we had flies playing each other, the obvious next question was “which fly would you bet on?”, and that became the game.
What it does
Full House-Flies is a 3D poker room where five AI flies play Texas Hold’em against each other while you bet on who wins each hand.
Five flies, five personalities: Vera (tight-aggressive), Buzz (loose-aggressive), Nib (tight-passive), Callie (calling station) and Mani (maniac). They learn as they play: each fly runs on a small neural circuit loosely modelled on how a fly’s brain is organised. After every hand it strengthens or weakens its connections depending on whether it won or lost chips, and it keeps track of how its opponents play. You bet on them: before each hand a 10-second betting window slides up with live odds on every fly. Pick a chip, back a fly, or skip ahead. The window then slides away while the hand plays out. Payouts like a racetrack: all bets go into one pool and whoever backed the winner splits it. The odds shift as people bet, ties split the pool, and everyone gets refunded if nobody backed the winner. Auto-play: hands run back to back. A “!” pops up for 2 seconds whenever you can place a new bet, so you can sit back and still jump in.
How we built it
Poker engine: plain JavaScript, with a hand evaluator, betting rules, side pots and equity estimates, plus tests for hand rankings. Fly brains: a 45-neuron circuit for each fly, with layers for sensing the game, a recurrent core, and outputs for fold, check, call, bet and raise. On top of that sit playstyle settings and a reward-based learning rule that runs after every hand. 3D room: three.js, with a fly for each seat, cards on the table, and an inspector that shows a fly’s stats, its circuit activity, and what it learned last hand. Betting backend: Python with FastAPI and SQLite. Money is stored in whole cents, every balance change goes into an audit ledger, and each bet is processed in a single database transaction so it can’t be spent twice or paid out twice. A pytest suite covers payouts, ties, refunds and edge cases. Betting UI: built into the game’s bottom dock, with a bet card above each fly’s name plate, a chip rack, the bankroll, and the timed window with slide animations.
Challenges we ran into
Merging two interfaces into one: the first betting panel sat on top of the game’s own controls and covered the buttons you need to play. We rebuilt it so each fly’s bet card sits directly above its name plate, in the game’s colour scheme, and gets out of the way while a hand is in play. Getting the money right: a betting pool has awkward edge cases, like split pots, nobody backing the winner, rounding leftovers, and someone betting twice in the same instant. We used whole cents, database transactions and tests to make sure the money in always equals the money out. Timing the betting window: we had to keep the betting UI, the auto-play loop and the server in sync, so that a hand never starts with betting still open and a bet never lands after the round is locked. Git and loading bugs: a merge left conflict markers inside our JavaScript files, and a blocked CDN download for three.js left the game on an endless loading screen. Neither showed a helpful error, so we added a message that explains what failed instead of spinning forever.
Accomplishments that we're proud of
The flies feel genuinely different from each other: Mani bluffs wildly, Nib folds almost everything, and Callie never lets go of a hand. The flies actually learn. Their circuits change hand by hand based on results, and you can watch it happen in the inspector. The betting maths is careful: no money is created or lost, ties and refunds are handled, and there are tests to prove it. It feels like a game rather than a demo, with the 3D room, the slide-in betting window, the countdown and the “!” prompt.
What we learned
How pari-mutuel betting works, and why real betting systems store money as whole numbers instead of decimals. How biological neural circuits are organised, and how much a small circuit with a simple learning rule can do. That small UI decisions, like where a button sits and when a panel appears, change how a game feels more than we expected. Practical lessons in team git workflows, browser caching, and making failures show a clear message instead of failing silently.
What's next for Full House-Flies
Real connectome data: replace our 45-neuron sketch with wiring taken from the published fruit fly larva connectome. Betting with friends: let several people share the same table and pool in real time. Proper accounts: real login, plus leaderboards and betting history. More to watch: charts of how each fly’s play changes as it learns, and replays of big hands. Tournaments: longer matches where flies get knocked out, so you can follow a fly over a whole run.
Built With
- ai
- cnn
- gemini
- machine-learning
- ml
- neural
- poker
- python
- react
- three.js
Log in or sign up for Devpost to join the conversation.