chess

12 dominating knights puzzle (backtracking)

允我心安 提交于 2019-12-03 16:29:52
问题 I've been searching for hours and haven't found a fully working solution for this kind of puzzle yet. So I followed similar problem with bishops. What I need to do is place 12 knights on the chess board in such a way, that all free squares of the board are attacked by at least one piece. The final result should look like this: The problem is that my program only tries different combinations with two last pieces and then somehow crashes. EDITED What I have done so far: #include <iostream>

12 dominating knights puzzle (backtracking)

余生长醉 提交于 2019-12-03 04:57:08
I've been searching for hours and haven't found a fully working solution for this kind of puzzle yet. So I followed similar problem with bishops. What I need to do is place 12 knights on the chess board in such a way, that all free squares of the board are attacked by at least one piece. The final result should look like this: The problem is that my program only tries different combinations with two last pieces and then somehow crashes. EDITED What I have done so far: #include <iostream> using namespace std; #define N 8 void fillChessBoard(int (&chessBoard)[N][N], int num); void

How do I model a chessboard when programming a computer to play chess?

人走茶凉 提交于 2019-12-03 04:17:31
问题 What data structures would you use to represent a chessboard for a computer chess program? 回答1: Initially, use an 8 * 8 integer array to represent the chess board. You can start programing using this notation. Give point values for the pieces. For example: **White** 9 = white queen 5 = white rook 3 = bishop 3 = knight 1 = pawn **black** -9 = white queen -5 = white rook -3 = bishop -3 = knight -1 = pawn White King: very large positive number Black King: very large negative number etc. (Note

Chess: high branching factor

旧时模样 提交于 2019-12-03 02:29:30
问题 I'm trying to develop a simple chess engine, but I'm struggling with its performance. I've implemented Negamax with alpha-beta pruning and iterative deepening (without any additional heuristics), but I'm unable to get reasonable search time beyond 3-4th ply. Here is an excerpt from my program's log from the beginning of the game: 2013-05-11 18:22:06,835 [9] INFO CoevolutionaryChess.Engine.MoveSearchers.NegamaxMoveSearcher [(null)] - Searching at depth 1 2013-05-11 18:22:06,835 [9] DEBUG

Chess Optimizations

荒凉一梦 提交于 2019-12-03 02:02:05
问题 ok, so i have been working on my chess program for a while and i am beginning to hit a wall. i have done all of the standard optimizations (negascout, iterative deepening, killer moves, history heuristic, quiescent search, pawn position evaluation, some search extensions) and i'm all out of ideas! i am looking to make it multi-threaded soon, and that should give me a good boost in performance, but aside from that are there any other nifty tricks you guys have come across? i have considered

Chess game in JavaScript [closed]

霸气de小男生 提交于 2019-12-03 00:49:28
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . Is there any Chess game API , purely written in JavaScript ? No Flash! Anybody know the algorithm(in general) used in Chess games ? 回答1: How does a chess algorithm work?: What a chess computer tries to do is

Preventing cheating in online chess games? [closed]

倖福魔咒の 提交于 2019-12-03 00:26:50
In many online chess lobbies, I've seen instances of 'engining', where a cheater would open a chess program at the same time as the main game window. He would then set it up so that the opponent's moves are relayed to the computer, then which he would copy the computer's moves, until he (almost always) wins. As a game developer and moderator, what is there to do about this situation? Bill the Lizard Online poker sites use anti-bot measures similar to what you're describing. I recommend the series of articles How I Built a Working Poker Bot for a good overview of how these systems work, and how

Chess: high branching factor

旧时模样 提交于 2019-12-02 16:01:26
I'm trying to develop a simple chess engine, but I'm struggling with its performance. I've implemented Negamax with alpha-beta pruning and iterative deepening (without any additional heuristics), but I'm unable to get reasonable search time beyond 3-4th ply. Here is an excerpt from my program's log from the beginning of the game: 2013-05-11 18:22:06,835 [9] INFO CoevolutionaryChess.Engine.MoveSearchers.NegamaxMoveSearcher [(null)] - Searching at depth 1 2013-05-11 18:22:06,835 [9] DEBUG CoevolutionaryChess.Engine.MoveSearchers.NegamaxMoveSearcher [(null)] - Leaves searched: 28 2013-05-11 18:22

Chess Optimizations

♀尐吖头ヾ 提交于 2019-12-02 15:38:37
ok, so i have been working on my chess program for a while and i am beginning to hit a wall. i have done all of the standard optimizations (negascout, iterative deepening, killer moves, history heuristic, quiescent search, pawn position evaluation, some search extensions) and i'm all out of ideas! i am looking to make it multi-threaded soon, and that should give me a good boost in performance, but aside from that are there any other nifty tricks you guys have come across? i have considered switching to MDF(f), but i have heard it is a hassle and isn't really worth it. what i would be most

Programmer Puzzle: Encoding a chess board state throughout a game

感情迁移 提交于 2019-12-02 13:46:49
Not strictly a question, more of a puzzle... Over the years, I've been involved in a few technical interviews of new employees. Other than asking the standard "do you know X technology" questions, I've also tried to get a feel for how they approach problems. Typically, I'd send them the question by email the day before the interview, and expect them to come up with a solution by the following day. Often the results would be quite interesting - wrong, but interesting - and the person would still get my recommendation if they could explain why they took a particular approach. So I thought I'd