Skip to content

Supsource/Rock-Paper-Scissors-JS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rock-Paper-Scissors-JS

An advanced Rock-Paper-Scissors game that uses machine learning to predict player moves based on their previous choices.

🚀 Features

  • 🔄 Adaptive AI: The computer initially plays randomly but learns and predicts moves based on your past choices.
  • 🤖 Neural Network Training: The AI trains itself every time it loses to improve its predictions.
  • 📊 Pattern Recognition: The AI stores your last two moves to find patterns and anticipate your next choice.
  • 🎮 Classic Gameplay: Enjoy the traditional Rock-Paper-Scissors experience with a modern AI twist.

🛠️ How It Works

  1. The game starts with the computer choosing moves randomly for the first three rounds.
  2. After collecting enough data, the AI predicts the player's next move based on their last two choices.
  3. If the AI predicts "Rock," it plays "Paper" to counter it (and similarly for other moves).
  4. If the AI loses, it retrains its model to improve future predictions.

🖥️ Installation & Usage

  1. Clone the repository:
    git clone https://github.com/Supsource/Rock-Paper-Scissors-JS.git
  2. Navigate to the project directory:
    cd Rock-Paper-Scissors-JS
  3. Open index.html in your browser to start playing.

🔧 Technologies Used

  • HTML5, CSS3, JavaScript (ES6+)
  • Neural Network-based learning approach

🛠️ Contributing

Pull requests and stars are always welcome! If you'd like to contribute:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Commit your changes (git commit -m 'Add new feature').
  4. Push to the branch (git push origin feature-branch).
  5. Open a Pull Request.

📜 License

This project is licensed under the MIT License. See the LICENSE file for details.