Giter Site home page Giter Site logo

nqueens's Introduction

nQueens

Here's a solution to the nQueen's algorithm using bit shifting and bitwise operators.

The algorithm operates on the premise that a chessboard's current state can be represented by 8 bit binary numbers.

[i.e. given n = 4; n empty columns ==== 0000]

Academic History

The nQueens problem has been tackled by many academics who try to improve the time complexity of the algorithm that finds ways to place any number of queens (represented by n) on an n x n board size.

To see a more thorough explanation of the problem and bit solution, check out: nQueens research

Specifications

This nQueens solution is implemented in Javascript, to read more about Javascript bitwise operators -- refer to Mozilla's documentation on bitwise operators.

Installation

git clone https://github.com/bigthyme/nQueens.git
cd nQueens

After doing this, you can just copy and paste the contents of nQueens.js and paste it into your browser console (or node console) to run the code.

License

MIT License

nqueens's People

Contributors

bigthyme avatar

Stargazers

 avatar Andrew Selbie avatar Will Ngo avatar Nathan Houle avatar Mark Lee avatar

Watchers

James Cloos avatar  avatar

Forkers

quetzaluz

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.