This is a simple terminal-based Rock-Paper-Scissors multiplayer game built using Java Sockets. It demonstrates basic distributed systems concepts such as client-server communication, multi-threading, and synchronization.
- Play Rock-Paper-Scissors over a network
- Two-player real-time gameplay
- Terminal-based UI
- TCP-based client-server communication
- Handles synchronization between clients
- Easy to run and extend
+------------+ TCP Socket +-------------+ TCP Socket +------------+
| Client 1 | <=================> | Server | <=================> | Client 2 |
+------------+ +-------------+ +------------+
- Language: Java 17+
- Communication: Java Sockets (TCP)
- UI: Terminal
- Threading: Java Multi-threading
javac *.javajava RPSServerjava RPSClient- Both players are prompted to enter their move (rock, paper, or scissors).
- Server waits until both moves are received.
- It then compares the moves and sends the result back to both players.
- Players can then choose to play again or exit.
.
├── RPSClient.java # Client-side logic
├── RPSServer.java # Server that handles connections and game logic
├── GameHandler.java # Threaded class to handle each client
├── Utils.java # Game logic (winner calculation)Client 1
Connected to server.
Enter your move (rock/paper/scissors): rock
Waiting for other player...
Result: You Win! 🎉
Client 2
Connected to server.
Enter your move (rock/paper/scissors): scissors
Waiting for other player...
Result: You Lose 😞
- Client-server architecture
- Java Sockets (TCP)
- Multi-threading and synchronization
- Real-time message passing
- Basic distributed game logic
- GUI using JavaFX or Swing
- More players / tournament mode
- Match history log
- WebSocket version
Gajanan Rathod, Kunal Puri, Mann Monpar, Shruti Amrutkar
🎓 [DISTRIBUTED SYSTEMES MINI PROJECT - SCOE - IT / 8th Semester]
MIT License – feel free to modify and distribute.