Skip to content

itspedruu/queens-solver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Queens Solver

This is a solver for the Queens game, an original LinkedIn game.

Run

  1. Clone the repo
  2. Run npm run start <file-path>

Note: The file should be a JSON file with a N x N matrix where each cell is the color id (a char). There is an example in the examples folder

Strategies used

This are a few of the strategies you develop naturally playing the game which are all you need to solve the puzzle.

Color Set

Any set of N colors that can only be placed in N columns or N rows are the only colors that will have queens in said N columns or N rows. You can eliminate any color that does not belong to said set.

Example: In the following image, the pink and the orange colors can only be placed in columns 2 and 3

Queens Level 507

Being that it is 2 colors that can only be placed in those 2 columns then no other color can be placed in those columns.

Queens Level 507 with candidates eliminated

Solo Candidates

Solo candidates as the name describes are colors that only have one possible candidate therefore the queen must be there.

Example: Purple has only one possible candidate

Queens Level 503

Killers

Killers are candidates that eliminate an entire color if a queen was placed there.

Example: If there were to be a queen in the place of the eliminated candidate then the purple color would not be solvable. Note: A killer is any candidate that neighbours a subset of the purple figure example.

Killer example

About

A Queens, original LinkedIn game, solver.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published