Git Product home page Git Product logo

knights-tour's Introduction

Knight's Tour

This program solves the Knight's Tour Problem, as stated by Euler. If you have a knight in a chess game, you can make it go through the whole chessboard without going twice on the same square, if the start square is well chosen.

This Prolog program (comments in french) solves this problem using the following heuristic : the knight should go to the square which has the littlest number of possible next moves. It can be used on chessboards of size 25x25 and it finds solutions in a sufficient response time.

Usage

swipl -s knights_tour.pl

Then answer the questions about the size of the chessboard, then type:

go.

knights-tour's People

Contributors

bnjbvr avatar

Stargazers

Adalberto Caldeira Brant Filho avatar Domitila Crispim avatar Aashika Vasra avatar  avatar Abdulmalek dery avatar Laura Brown avatar Appa avatar

Watchers

James Cloos avatar  avatar  avatar Aashika Vasra avatar

Forkers

domitilacrispim

knights-tour's Issues

Naive method not working

Hi,
When I commented the heuristic method and went on with the naive method, the code didn't work. After giving the command go., there was no output and the cursor kept blinking for a long time. For naive method also, we are supposed to compile code, answer the questions and then go, right? Is my way of execution correct? Correct me if I am wrong.

I have attached a screenshot of the output as a proof.
image

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.