|
1 |
| -# React + Vite |
| 1 | + |
| 2 | +# ♟️Chess |
| 3 | + |
| 4 | +A simple chess game implemented using React. |
| 5 | + |
| 6 | +## Features and Functionality |
| 7 | + |
| 8 | +* **Interactive Chessboard:** A fully functional 8x8 chessboard rendered using React components. |
| 9 | +* **Piece Movement:** Implements movement rules for all chess pieces (Pawn, Rook, Knight, Bishop, Queen, and King). |
| 10 | +* **Turn-Based Gameplay:** Alternates turns between White and Black players. |
| 11 | +* **Move Validation:** Validates moves according to chess rules, including checks for valid paths and piece collisions. |
| 12 | +* **Highlighting Valid Moves:** Highlights available moves for a selected piece. |
| 13 | +* **Check and Checkmate Detection:** Detects check and checkmate situations using hooks. |
| 14 | +* **Stalemate Detection:** Detects stalemate situations. |
| 15 | +* **Pawn Promotion:** Allows pawn promotion to Queen, Rook, Bishop, or Knight upon reaching the opposite end of the board. |
| 16 | +* **Castling:** Implements castling move for the King and Rook pieces. |
| 17 | +* **Responsive Design:** Adapts the board size to the screen size. |
| 18 | + |
| 19 | +## Technology Stack |
| 20 | + |
| 21 | +* **React:** A JavaScript library for building user interfaces. |
| 22 | +* **JavaScript (ES6+):** The primary programming language. |
| 23 | +* **JSX:** A syntax extension to JavaScript, used to describe UI components. |
| 24 | +* **CSS:** For styling the application. |
| 25 | +* **Vite:** A build tool that provides a fast and efficient development experience. |
| 26 | +* **Context API:** For managing application state. |
| 27 | + |
| 28 | +## Prerequisites |
| 29 | + |
| 30 | +Before running the application, ensure you have the following installed: |
| 31 | + |
| 32 | +* **Node.js:** JavaScript runtime environment. Download from [https://nodejs.org/](https://nodejs.org/) |
| 33 | +* **npm** (Node Package Manager): Usually comes with Node.js installation. |
| 34 | +* **Git:** Recommended for cloning the repository. |
| 35 | + |
| 36 | +## Installation Instructions |
| 37 | + |
| 38 | +1. **Clone the repository:** |
| 39 | + |
| 40 | + ```bash |
| 41 | + git clone https://github.com/bitan2504/Chess.git |
| 42 | + cd Chess |
| 43 | + ``` |
| 44 | + |
| 45 | +2. **Install dependencies:** |
| 46 | + |
| 47 | + ```bash |
| 48 | + npm install |
| 49 | + ``` |
| 50 | + |
| 51 | +## Usage Guide |
| 52 | + |
| 53 | +1. **Start the development server:** |
| 54 | + |
| 55 | + ```bash |
| 56 | + npm run dev |
| 57 | + ``` |
| 58 | + |
| 59 | + This will typically start the application at `http://localhost:5173/`. Open this URL in your browser. |
| 60 | + |
| 61 | +2. **Playing the Game:** |
| 62 | + * Click on a chess piece to select it. Valid moves for the selected piece will be highlighted. |
| 63 | + * Click on a highlighted square to move the piece to that location. |
| 64 | + * The game automatically switches turns between White and Black. |
| 65 | + * Pawn promotion prompts you to select the piece to promote to (Queen, Rook, Bishop, or Knight) when a pawn reaches the opposite rank. |
| 66 | + * The game displays alerts for checkmate, stalemate, and when a player wins. |
| 67 | + |
| 68 | +## 💡How to Contribute? |
| 69 | +1. Fork the repository. |
| 70 | +2. Create a new branch for your feature: |
| 71 | + |
| 72 | + ```bash |
| 73 | + git checkout -b feature-name |
| 74 | + ``` |
| 75 | +3. Make changes and commit: |
| 76 | + ```bash |
| 77 | + git add . |
| 78 | + git commit -m "Added a new feature" |
| 79 | + ``` |
| 80 | +4. Push to your branch: |
| 81 | + ```bash |
| 82 | + git push origin feature-name |
| 83 | + ``` |
| 84 | +5. Create a Pull Request (PR) on GitHub. |
| 85 | + |
| 86 | +## React + Vite |
2 | 87 |
|
3 | 88 | This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
4 | 89 |
|
5 | 90 | Currently, two official plugins are available:
|
6 | 91 |
|
7 | 92 | - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
|
8 | 93 | - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
| 94 | + |
| 95 | +## API Documentation |
| 96 | + |
| 97 | +This project does not expose a public API. |
| 98 | + |
| 99 | +## Contributing Guidelines |
| 100 | + |
| 101 | +Contributions are welcome! To contribute: |
| 102 | + |
| 103 | +1. Fork the repository. |
| 104 | +2. Create a new branch for your feature or bug fix. |
| 105 | +3. Implement your changes. |
| 106 | +4. Test your changes thoroughly. |
| 107 | +5. Submit a pull request with a clear description of your changes. |
| 108 | + |
| 109 | +#### Feel free to explore, modify, and enhance the project! 😊 |
0 commit comments