30DaysOfJavaScript icon indicating copy to clipboard operation
30DaysOfJavaScript copied to clipboard

Added Othello Game

Open AsmitaMishra24 opened this issue 1 year ago • 1 comments

🛠️ Fixes Issue (Number)

Example: Closes #1799

👨‍💻 Changes proposed and Brief Description

Added a fully functional Othello (Reversi) game. The game includes the following features:

  1. Board Setup: Initializes an 8x8 game board with the initial four pieces placed in the center.
  2. Piece Placement: Allows players to place pieces on the board according to Othello rules.
  3. Legal Move Highlighting: Highlights squares where the current player can legally place a piece.
  4. Piece Flipping: Flips opponent's pieces in all directions as per the game rules when a piece is placed.
  5. Turn Switching: Alternates turns between the white and black players, with indicators for the active player.
  6. Score Tracking: Displays and updates the score for both players in real time.
  7. End Game Detection: Detects when the game ends and displays a message indicating the winner or if the game is a draw.
  8. No Legal Move Handling: Handles cases where a player has no legal moves and passes the turn to the opponent.

✅ Check List (Check all the applicable boxes)

  • [X] My code doesn't break any part of the project
  • [X] This PR does not contain plagiarized content.
  • [X] My Addition/Changes works properly and matches the overall repo pattern.
  • [X] The title of my pull request is a short description of the requested changes.

📷 Screenshots

2othello

1othello

AsmitaMishra24 avatar Jun 22 '24 18:06 AsmitaMishra24

Deploy Preview for 30daysofjs ready!

Name Link
Latest commit 0ccf64fdd90535c98a548a30d70547151182c902
Latest deploy log https://app.netlify.com/sites/30daysofjs/deploys/66771dba6fa1e00008241c35
Deploy Preview https://deploy-preview-1865--30daysofjs.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Jun 22 '24 18:06 netlify[bot]

@swapnilsparsh, please review the pr

AsmitaMishra24 avatar Jul 06 '24 18:07 AsmitaMishra24

@swapnilsparsh, please review the pr

AsmitaMishra24 avatar Jul 11 '24 11:07 AsmitaMishra24