So, I got this idea stuck in my head the other day – making a rock-paper-scissors game, but for three players, and playable online. Seemed simple enough, right? Famous last words.
Getting Started
First thing, I sat down and just thought about how three players changes the game. It’s not just one-on-one anymore. You can have one winner, two winners (if two pick the winning sign against the third), or everyone ties (all same sign, or all different signs). That last one, all different, that’s unique to more than two players. Honestly, someone told me once all choices are equal mathematically, no reason to pick one over the other. Seemed straightforward on paper.

Then came the ‘online’ part. That means needing some kind of server to handle players connecting, taking their choices (rock, paper, or scissors), and then telling everyone who won or lost or tied. Decided to use some simple tools I already knew, nothing fancy, just wanted to get it working quickly. Grabbed * for the backend stuff, it’s usually quick for these little network things.
Coding the Thing
Okay, coding the basic rules wasn’t too bad. I mapped out the logic:
- Get choices from Player 1, Player 2, Player 3.
- Check if everyone picked the same thing. That’s a tie.
- Check if everyone picked a different thing (one rock, one paper, one scissors). Also a tie.
- Otherwise, figure out the winning sign and who picked it. If only one person picked the winner, they win. If two people picked the winner, they both win against the third loser.
Getting this logic right took a bit of fiddling, more than I expected for plain old rock-paper-scissors. Had to test it with a few combinations just running it locally on my machine.
Going Online
This was the tricky bit. Setting up the server part. I used WebSockets, that way the server can push updates to everyone’s browser instantly without them needing to refresh. So, player connects, server keeps track. Player makes a choice, sends it to the server. Server waits until it has choices from all three connected players.
Once all three choices are in, the server runs that game logic I figured out earlier. Then it needs to send the results back to each player – telling them what everyone else chose and who won or lost. Getting the synchronization right, making sure it waited for all players before showing results, took some trial and error. There were definitely moments where results were firing off too early or messages getting crossed.
Making it Look Like Something
For the front end, what the players actually see and click, I kept it super basic. Just threw together some HTML. Needed:
- Buttons for Rock, Paper, Scissors.
- A space to show what you chose.
- A status area saying “Waiting for other players…” or showing the results.
- Maybe see what the other players picked after the round.
No fancy graphics, just functional. Click a button, your choice gets locked in and sent off. Then you wait. When the result comes back from the server, the page updates.

Testing and Bugs
First tests were just me opening three browser windows on my own computer. Found a few bugs right away. One time, it told everyone they won, which was funny but obviously wrong. Another time, if someone disconnected mid-game, it just hung forever waiting for their choice.
Had to add checks for players disconnecting and handle that state properly, maybe reset the game if someone leaves. Then I got a couple of friends to actually try it online with me. That helped find issues related to network lag or slightly different timings. We played a few rounds, fixed the obvious stuff.
Final Thoughts
It works! It’s a basic 3-player online rock-paper-scissors. Not gonna win any awards, but it was a fun little project. Took longer than I thought, mostly because of the online synchronization part. Even simple games get complicated when you add networking and multiple players.
It’s kinda satisfying seeing it run, though. Three people clicking buttons, seeing the results pop up almost instantly. A good way to spend an afternoon or two messing with code. Definitely reminded me that even the ‘simple’ ideas have hidden hurdles once you start building them for real.