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.
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.
-
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 -
Install dependencies:
npm init -y npm install
-
Start the server:
node app.js
(Assuming your main server file is named
app.js. Adjust if it's different.)
- Open your web browser and go to
http://localhost:3000(or the port your server runs on). - You will see the Rock-Paper-Scissors game interface. Use the buttons or links to choose your move (Rock, Paper, or Scissors).
- The server will respond with its choice and the game result.
Here's a brief overview of the project's file structure:
(Adjust the file names and directories to match your actual project structure.)
- 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).
- 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.
This project is licensed under the MIT License. (Or choose another license and link to it).
- gabaci