Questions tagged [knights-tour]

A knight's tour is a sequence of moves of a knight on a chessboard.

223 questions
-1
votes
1 answer

The knights tour for 8x8 infinite recurssion

here will be my code for famous Knights Tour for 8x8 deck. So, the main idea of my code is: we will choose from Turns our destination, check it with isPossible and then go recursevly to it, marked this cell to '1'. So, check every cell, and if we…
ratkke
  • 469
  • 1
  • 4
  • 13
-1
votes
3 answers

Knight's tour algorithm

So I have to write this algorithm (this version does not need to end in the same spot that knight started), and I got it to work, but it's too slow. It works with starting positions x=0 and y=0 for size=8, but if I try to manipulate x and y to for…
deviance
  • 97
  • 2
  • 5
  • 13
-1
votes
1 answer

Java Knight's Tour Homework

I am having some problems with this homework assignment. It is supposed to use a knight chess piece and take in the starting position on the board by the user and see if it can touch every position on the board. The board was already programmed by…
-2
votes
1 answer

c++ Knights tour using recursion

I know my code is extremely close I have all of my functions working except the moveKnight() function if you do not know what knights Tour is, it's a program we are writing to help learn recursion in class. The knight is suppose to touch every space…
-2
votes
1 answer

How to find a valid knight move in Python?

Chess knight can move to a square that is two squares away horizontally and one square vertically, or two squares vertically and one square horizontally. Given two different squares of the chessboard, determine whether a knight can go from the first…
-2
votes
1 answer

StackOverflowError in Knights Tour

I have this Knight's Tour code but am getting a java.lang.StackOverflowError on line 37. I'm not really sure where to go from here to fix it. I think the code in my main has something to do with it but I'm not sure what to do with it at this point.…
mattx2
  • 1
  • 1
-2
votes
1 answer

Java: How to move a knight on a chessboard until no possible moves are left

I have an assignment to have a knight move around the chessboard until it either completes a full tour or has no where else to go. im having a problem figuring out how to have it actually stop after there are no more moves. I have the algorithm for…
-2
votes
1 answer

Initialization of user-defined array in C++ class?

I'm working on knight's tour problem, and want to define a class, but I am having trouble with initialize an array defined by user. So the user inputs from the command line argvs are the chessboard lengths mX and nY; and a starting position(x,y). So…
Zoey A
  • 11
  • 1
  • 7
-3
votes
2 answers

Knight's Tour Brute Force Recursion

I'm trying to write a program that allows the user to enter any coordinate on a chess board and complete the knight's tour using brute force recursion. I am getting an infinite loop and I have no idea why. This is in C++, and I have to write this…
-3
votes
2 answers

Knight Tour Index and Moving Algorithm Bugs

The goal of this program is for the knight to move around the chest board and only touching each spot once. Each spot is initialized and set to zero by default. As the knight moves, each spot the knight touches should correspond with the number of…
-3
votes
1 answer

Knights Tour Issue

I am attempting to complete the infamous "Knights tour" Where the knight must move around the entirety of a chess board until it has no more options or completes the board. I am getting unwanted out of bounds errors on my "movement" code and can't…
-3
votes
1 answer

haskell Chess Knight Tour: Function composition

I've a hard time understanding a Chess Knight problem concerning function composition. The exercise is a generator/filter/selector chain with a given wrapper function (knightProblem) which glues everything together. It is unclear to me how the…
-3
votes
1 answer

Variable without initialization returns segmentation fault

Description: A friend of you is doing research on the Traveling Knight Problem (TKP)where you are to find the shortest closed tour of knight moves that visits each square of a given set of n squares on a chessboard exactly once. He thinks that…
boygood
  • 103
  • 1
  • 10
1 2 3
14
15