Skip to content

Repository files navigation

🎯 NumGuess – Multi-Client Number Guessing Game (C# & Python)

NumGuess is a network-based number guessing game built using C# and Python.
The system implements a client-server architecture where a C# server handles game logic, and both C# and Python clients can connect to it.

This project demonstrates socket programming, cross-language interoperability, structured server-side session management, and collaborative development.


🤝 Collaboration

The C# implementation (Client + Server) was developed in collaboration with Marc.

The Python client was independently developed by Sandip Bohara Chhetri.

This project showcases both collaborative development and independent cross-language extension.


🏗 System Architecture

Clients:
   ├── C# Client
   └── Python Client

Both connect via:
   └── TCP Socket Connection

Server:
   └── C# Server
         ├── Random Number Generator
         ├── Game Logic Engine
         └── Sends Response Back to Client

🎮 Game Features

  • Client-server architecture
  • C# server handles core game logic
  • Supports multiple client implementations (C# and Python)
  • Random number generation on server
  • Real-time guess validation
  • Feedback system:
    • "1 = Too High"
    • "-1 = Too Low"
    • "0 = Correct"
  • Continuous guessing loop
  • Cross-language socket communication

📂 Project Structure

NumGuess/
│
├── Marc_Sandip_Server/
│   (C# Client + Server – Collaborative)
│
├── NumGuess_Client_Py/
│   (Python Client – Independent)
│
├── assets/
│
├── GDIDrawer.dll
├── MHannah_ConnectLib.dll
├── generic_connection_dialog.dll
│
├── .gitignore
└── README.md

💻 C# Implementation (Client + Server)

Technologies Used

  • Language: C#
  • Framework: .NET
  • Networking: TCP Socket Programming
  • Libraries:
    • MHannah_ConnectLib.dll
    • generic_connection_dialog.dll

C# Server Responsibilities

  • Generate random number
  • Accept client connections
  • Process incoming guesses
  • Send evaluation responses
  • Maintain game session state

C# Client Responsibilities

  • Connect to server
  • Send guesses
  • Receive feedback
  • Display results to user

Run (C#)

  1. Open solution in Visual Studio
  2. Build the project
  3. Run the server
  4. Run the C# client
  5. Start guessing

🐍 Python Client

Technologies Used

  • Language: Python 3
  • socket module

Responsibilities

  • Connect to C# server
  • Send guesses
  • Receive and display feedback
  • Maintain interactive loop

Run (Python)

Navigate to NumGuess_Client_Py directory and run:

python NumGuess.py


🧠 Concepts Demonstrated

  • Client-server architecture
  • TCP socket communication
  • Cross-language interoperability
  • Network session handling
  • Distributed system design
  • Random number generation
  • Conditional and loop control flow
  • Collaborative software development

🚀 Possible Improvements

  • True multi-client simultaneous gameplay
  • GUI version (WinForms / Tkinter)
  • Score tracking system
  • Leaderboard persistence
  • Logging system
  • Error and timeout handling improvements
  • Authentication layer

🎓 Educational Purpose

This project was developed to strengthen understanding of:

  • Socket programming
  • Network-based application design
  • Cross-language system integration
  • Distributed game logic architecture

👨‍💻 Authors

Sandip Bohara Chhetri
Computer Engineering Technologist

Marc C# Client/Server Collaborator

About

TCP client/server number guessing game built with C# WinForms using asynchronous sockets and JSON messaging. Includes a C# client and a Python socket client for cross-language testing. The server generates a number (0–1000) and returns feedback codes (-1, 0, 1) over TCP.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages