Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related Issue
None
closes:#545
Description
This code is a web-based implementation of the "Pig Game", a two-player dice game where players compete to reach a target score of 100 points first. It consists of three main components:
Provides the layout for the game interface.
Includes:
Player sections for Player 1 and Player 2 with their scores (total and current).
Game controls (buttons to roll dice, hold, and start a new game).
A dice display area for the current dice roll.
A footer explaining the game rules.
Utilizes Bootstrap for responsive design and Font Awesome for icons.
Modern and visually appealing design with gradients, shadows, and animations.
Features:
Color-coded backgrounds to indicate the active player and winner.
Hover effects and smooth transitions for interactive elements.
Responsive layout adjustments for smaller screens.
Implements game functionality:
Rolling Dice: Generates a random dice value and updates the display.
Holding Score: Adds the current score to the player's total and switches turns.
Switching Players: Alternates between players when a 1 is rolled or after holding.
Winner Detection: Declares a winner when a player reaches the target score (100).
Event Handlers:
Attach functions to the roll, hold, and new game buttons.
Use helper functions to update the UI and manage game state.
Game Initialization: Resets the game for a new round.
Type of PR
check in issue by entering [X] in boxes
Screenshots / Videos (if applicable)
[Attach any relevant screenshots or videos demonstrating the changes]
Checklist