Building Satdoku VersusBuilding Satdoku Versus
Few weeks ago, I posted my vibe coded sudoku game where you can pay with sats to keep playing if you run out of lives: #1393082
Since then, I've created a "Versus" mode where you can invite a friend and play against them live.
I'm particularly proud of this one because turns out real-time multiplayer is hard.
You have to choose what's ephemeral and what's not, how that information gets communicated, what gets stored, manage states, and more.
At first I was able to build v1 with websockets locally. But then I realized I couldn't do it in production with Vercel because it's serverless. I then switched to supabase realtime + supabase which was really difficult to figure out and almost gave up.
But in the end, I got it working and am pretty happy with how it turned out.
Versus RulesVersus Rules
The basic rules are:
- Invite a play by sharing a link
- Both players press start to play
- Player with more points at the end of the gamewins (PS completing columns and boxes count more)
- Cells your opponent fills are highlighted in orange
- Buy a life with bitcoin if you run out. You get redirected back to the game to keep playing after. One of the benefits of lightning is that payments are pretty fast. :)
I think the next step after this is to add a betting element to the game where people can bet sats. Will update you all when that goes live. It ultimately depends on the mdk team but they ship pretty fast so should be pretty soon.
I hope you give it a try, even if you're a sudoku noob. Just play against another noob. And at the end of the day, I hope you get to experience the fun of playing sudoku!
Here's the link to play! https://www.satdoku.org/versus
https://twiiit.com/satdoku/status/2010348068076736552