Giter Club home page Giter Club logo

eightqueens's Introduction

Description

A while back I heard of a problem about chess and it intrigued me. The problem states:

On a chess board (8 x 8) place 8 queens so that no two queens can attack each other. As a result, the computed solutions will require that any queen added on the board should not share a row, column, or diagonals with any other queen already positioned.

Additionally this problem can be scaled to any Natural Number n ( n != 2 && n != 3) where n (non-attacking) queens are placed on an n x n chessboard. (Optionally: A visual representation can be given of the possible arrangements )

My method of approach

I think someone out there can find an even better way to do this but I will choose a very popular approach to this problem.

Getting started with providing input to the current program

Build

In the command line/terminal run: ./gradlew build

Running the program

In the command line/terminal run: java -jar build/libs/EightQueens-0.0.1.jar By playing with the program and inputting all kinds of numbers it will be noticed that a StackOverflow message will appear for any number (n > 9). To see all result for a number n > 9 the following command needs to be ran: java -jar -Xss1024m build/libs/EightQueens-0.0.1.jar <= This command increases the stack of the current java program to 1024mb. The -Xss attribute can have multiple values e.g.:
java -jar -Xss4m <path_to_jar>
java -jar -Xss8m <path_to_jar>
java -jar -Xss16m <path_to_jar>
java -jar -Xss32m <path_to_jar>
java -jar -Xss64m <path_to_jar>
java -jar -Xss128m <path_to_jar>
java -jar -Xss256m <path_to_jar>
java -jar -Xss512m <path_to_jar>
java -jar -Xss1024m <path_to_jar>

ToDo

  • Add main class
  • Add backtracking class
  • Add simple logic of backtracking class (all possible permutation for a number n)
  • Improving logic for the problem at hand
  • Create visual representation
  • Build program and add documentation
    ** Optionally **:
    • Create API to compute visual representation of the created boards on a front-end.

eightqueens's People

Contributors

codrut51 avatar

Watchers

 avatar

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.