Skip to content

Algorithm to place N queens on said N×N chessboard so that no two queens threaten each other.

Notifications You must be signed in to change notification settings

Rafael-Anguiano/Web-Queens

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

N-Queens Problem

Problem:

  • Place N queens on said N×N chessboard so that no two queens threaten each other.
  • The Queen can move in it's line or row, or diagonally, any number of squares

Description

This is my solution for this problem/puzzle.

This algorithm shows only one solution by time runned.

  • Made using Javascript.

Installation

To install this repository correctly follow the next steps.

  1. First of all, in the terminal put the next code to clone this repository:

        git clone https://github.com/Rafael-Anguiano/Web-Queens.git
        cd N-Queens/
  2. The next step is install the dependencies and node-modules.

        npm install
  3. Once you have installed the dependencies, you are ready to start simulating and editing some code. To run this app run the next command in the terminal (Be sure you are in the correct directory).

        npm start

Notes:

  • There are many different ways to solve this puzzle with the same input.
  • The algorithm have a random percentage, this means you could receive a different solution each time.
  • The Queen can move in its line or row, or diagonally, any number of squares.

Developed By:

Rafael de Jesús Anguiano Suárez del Real (December 2022).

About

Algorithm to place N queens on said N×N chessboard so that no two queens threaten each other.

Topics

Resources

Stars

Watchers

Forks