A Chrome extension that automatically solves the n-Queens puzzle with color region constraints. The solver ensures that:
- No two queens can be in the same row, column, or adjacent cells
- Each color region can only contain one queen
- Pre-placed queens are respected in the solution
- Parses the puzzle grid directly from the webpage
- Automatically solves the puzzle using backtracking algorithm
- Places queens on the board by simulating clicks
- Handles puzzles of different sizes
- Respects existing queens and color region constraints
-
Clone this repository:
git clone https://github.com/Akonibrahim/linkedinqueens
-
Open Chrome and navigate to
chrome://extensions/
-
Enable "Developer mode" by clicking the toggle switch in the top right corner
-
Click "Load unpacked" and select the directory containing the extension files
-
The Queens Puzzle Solver extension icon should now appear in your Chrome toolbar
Coming soon
-
Navigate to a webpage containing the n-Queens puzzle
-
Click the Queens Puzzle Solver extension icon in your Chrome toolbar
-
Click the "Solve Puzzle" button in the popup
-
The extension will automatically:
- Parse the current puzzle state
- Find a valid solution
- Place queens on the board by clicking the appropriate cells
queens-puzzle-solver/
├── manifest.json # Extension configuration
├── popup.html # Extension popup interface
├── popup.js # Popup interaction handling
└── solver.js # Main puzzle solving logic
The solver uses a backtracking algorithm that:
- Parses the initial board state including:
- Pre-placed queens
- Color regions
- Board dimensions
- Tracks constraints:
- Rows and columns with queens
- Color regions with queens
- Adjacent cells to existing queens
- Recursively tries to place queens while maintaining all constraints
- Returns the first valid solution found
- Google Chrome browser
- Basic understanding of JavaScript and Chrome extension development
- Make your changes to the source files
- Reload the extension in
chrome://extensions/
- Test the changes on a puzzle page
- Fork the repository
- Create a new branch for your feature
- Submit a pull request with a clear description of your changes