Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multiplayer 20 Questions

Multiplayer 20 Questions is a Java-based implementation of the classic guessing game “20 Questions,” designed for multiple players over a network. One player hosts the server, and others connect as clients to play together in real time.


Overview

The game allows several players to join a shared session where one player thinks of a word, and others take turns asking yes/no questions to guess it within 20 questions. It demonstrates fundamental concepts in Java socket programming, client-server communication, and multiplayer game logic.


How It Works

  • mainServer.java — Starts the main server, listens for incoming connections, and manages game sessions.
  • newClient.java — Connects a player to the server and provides the interface for asking questions and making guesses.
  • gameLogic.java — Contains the core logic that tracks questions, answers, turns, and determines when the game ends.

Getting Started

Prerequisites

  • Java 17 or later
  • A terminal or IDE

Compilation

From inside the project folder, compile all Java files:

javac *.java

Running The Server:

java mainServer

Running A Client:

java newClient

About

A multiplayer 20 Questions game built in Java using a client–server architecture. Features a central lobby server with dynamic port allocation, concurrent game sessions using threads, and custom TCP socket communication between players. Includes full game logic with categories, question limits, and win/loss conditions.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages