Skip to content

Implement Rock-Paper-Scissors-Lizard-Spock game in Node.js#4

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-3
Draft

Implement Rock-Paper-Scissors-Lizard-Spock game in Node.js#4
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-3

Conversation

Copilot AI commented Jul 4, 2025

Copy link
Copy Markdown

Added a complete console-based Rock-Paper-Scissors-Lizard-Spock game implementation in Node.js to the personas/app-dev directory.

Features Implemented

  • Interactive console game with clear instructions and rules display
  • Extended game rules following the Rock-Paper-Scissors-Lizard-Spock variant:
    • Rock crushes Lizard and crushes Scissors
    • Paper covers Rock and disproves Spock
    • Scissors cuts Paper and decapitates Lizard
    • Lizard poisons Spock and eats Paper
    • Spock smashes Scissors and vaporizes Rock
  • Best out of 5 games scoring system
  • Flexible input handling:
    • Full names: rock, paper, scissors, lizard, spock
    • Abbreviations: r, p, s, l, sp
    • Case-insensitive input
  • Comprehensive input validation with helpful error messages
  • Descriptive action messages (e.g., "rock crushes scissors")
  • Graceful exit with quit command
  • Modular code structure with exportable functions for testing

Files Added

  • rock-paper-scissors-lizard-spock.js - Main game implementation (252 lines)
  • rock-paper-scissors-lizard-spock-README.md - Comprehensive documentation and usage guide

Example Usage

$ node rock-paper-scissors-lizard-spock.js

Welcome to Rock-Paper-Scissors-Lizard-Spock!
==================================================
Rules:
• Rock crushes Lizard and crushes Scissors
• Paper covers Rock and disproves Spock
• Scissors cuts Paper and decapitates Lizard
• Lizard poisons Spock and eats Paper
• Spock smashes Scissors and vaporizes Rock

Best out of 5 games wins!
Enter your choice (rock, paper, scissors, lizard, spock)
You can also use abbreviations: r, p, s, l, sp
Type "quit" to exit the game.
==================================================

Game 1/5 - Enter your choice: rock

Round 1:
You chose: rock
Computer chose: scissors
You win! rock crushes scissors
Score: You 1 - 0 Computer

The implementation follows the repository's coding standards with proper documentation, error handling, and modular design.

Fixes #3.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: raffertyuy <1037626+raffertyuy@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement a Rock-Paper-Scissors-Lizard-Spock game in Nodejs Implement Rock-Paper-Scissors-Lizard-Spock game in Node.js Jul 4, 2025
Copilot AI requested a review from raffertyuy July 4, 2025 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement a Rock-Paper-Scissors-Lizard-Spock game in Nodejs

2 participants