30DaysOfJavaScript
30DaysOfJavaScript copied to clipboard
Added Othello Game
🛠️ Fixes Issue (Number)
Example: Closes #1799
👨💻 Changes proposed and Brief Description
Added a fully functional Othello (Reversi) game. The game includes the following features:
- Board Setup: Initializes an 8x8 game board with the initial four pieces placed in the center.
- Piece Placement: Allows players to place pieces on the board according to Othello rules.
- Legal Move Highlighting: Highlights squares where the current player can legally place a piece.
- Piece Flipping: Flips opponent's pieces in all directions as per the game rules when a piece is placed.
- Turn Switching: Alternates turns between the white and black players, with indicators for the active player.
- Score Tracking: Displays and updates the score for both players in real time.
- End Game Detection: Detects when the game ends and displays a message indicating the winner or if the game is a draw.
- 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
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...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
@swapnilsparsh, please review the pr
@swapnilsparsh, please review the pr