Skip to content

This project is the graduation project for the NodeJs foundation course. This project is a simple implementation of the classic game Rock-Paper-Scissors using Node.js. It serves as a basic example of how to create a web server with Node.js and handle HTTP requests.

License

Notifications You must be signed in to change notification settings

gabaci72/Rock-Paper-Scissors-NodeJS

Repository files navigation

Rock-Paper-Scissors Web Game with Node.js

Overview

This project is the graduation project for the NodeJs foundation course. This project is a simple implementation of the classic game Rock-Paper-Scissors using Node.js. It serves as a basic example of how to create a web server with Node.js and handle HTTP requests.

What Your Project Does

This project implements a web-based version of the classic game Rock-Paper-Scissors. You can play against the server by making choices through a simple web interface. The game logic is handled entirely on the server-side using Node.js.

Installation

  1. Clone the repository:

    git clone [https://github.com/gabaci72/Rock-Paper-Scissors-NodeJS.git](https://github.com/gabaci72/Rock-Paper-Scissors-NodeJS.git)
    cd Rock-Paper-Scissors-NodeJS
  2. Install dependencies:

    npm init -y
    npm install
  3. Start the server:

    node app.js

    (Assuming your main server file is named app.js. Adjust if it's different.)

Usage

  1. Open your web browser and go to http://localhost:3000 (or the port your server runs on).
  2. You will see the Rock-Paper-Scissors game interface. Use the buttons or links to choose your move (Rock, Paper, or Scissors).
  3. The server will respond with its choice and the game result.

Project Structure

Here's a brief overview of the project's file structure:

(Adjust the file names and directories to match your actual project structure.)

Technologies Used

  • Node.js: Runtime environment for the server-side JavaScript code.
  • HTTP Module (http): For creating the HTTP server and handling requests.
  • File System Module (fs): For serving HTML files (if you are doing so).
  • URL Module (url): For parsing URLs and extracting information.
  • HTML: For creating the user interface.
  • CSS: (Optional) For styling the user interface.
  • JavaScript: (Optional) For any client-side interactivity (though the description suggests server-side focus).

Possible Enhancements

  • Improved User Interface: Create a more visually appealing and user-friendly game interface using CSS and potentially client-side JavaScript.
  • Game History: Store and display the game history for the current session or across sessions.
  • User Accounts/High Scores: Implement user accounts to track scores and potentially create a leaderboard.
  • Different Game Modes: Explore variations of Rock-Paper-Scissors (e.g., Rock-Paper-Scissors-Lizard-Spock).
  • Testing: Add unit tests to ensure the game logic is robust.

License

This project is licensed under the MIT License. (Or choose another license and link to it).

Author

  • gabaci

About

This project is the graduation project for the NodeJs foundation course. This project is a simple implementation of the classic game Rock-Paper-Scissors using Node.js. It serves as a basic example of how to create a web server with Node.js and handle HTTP requests.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published