# Tagged Questions

Chess is a strategic game played with two players on a checkered grid. This tag is for challenges related to chess or any derivative of it.

4k views

### Knight on the Rim is Grim

Introduction Aron Nimzowitsch was a leading chess master and a influential chess writer. In his book 'My System', the first chapter deals about the importance of the center and why you should ...
490 views

### Chessboard maze

Chess pieces (kings, queens, rooks, bishops, and knights) and pawns are on a board, but not on the a1 or h8 square. Your task is to travel from the empty a1 to the empty h8 squares, passing through ...
1k views

### Convert a Forsyth-Edwards Notation string to ASCII art

In chess, Forsyth-Edwards Notation, more commonly called "FEN", is a textual way of transcribing boards. It describes each of the board's eight rows (called "ranks" in chess) from top to bottom from ...
4k views

For the non-zero digits on a standard numpad 789 456 123 consider placing a chess knight at any digit and moving it around with any number of normal L-shaped jumps, tracing out a positive decimal ...
558 views

### Seeking Leapers

I recently got a really weird irregular chess board. It's squares are all over the place and not even all connected. At least they're still laid out on a regular grid. I want to adapt the chess rules ...
146 views

### Convert a pawn promotion from algebraic to ICCF numeric notation

Input A single string, which contains no whitespace, as a command-line argument. Output If the string is not a valid algebraic notation pawn promotion, produce no output and exit. If the string is ...
116 views

### Diagram of a leaper [duplicate]

Given an input of a pair of nonnegative integers describing a leaper in chess, output a diagram of the squares to which the leaper can move. From Wikipedia's description: An (m,n)-leaper is a ...
200 views

### The knight's next tour

We've all heard of the Knight's Tour puzzle: find a route for a knight that passes through all the squares on a chess board. But let's be honest, it's a little bit boring. So, let's give the knight a ...
3k views

### Output all the white or black squares of a chessboard

Introduction This is how a chessboard looks like. You can see that a1 is a dark square. However, b1 is a light square. The Task The challenge is, given dark, light or both, output all the dark,...
100 views

### Chess-olition Derby

What could be more polar opposites than chess and demolition derby. You would think that no one who enjoys one would enjoy the other... until today. Rules The starting position is a standard chess ...
2k views

### Can the king catch the pawn?

Given an input of four integers x1, y1, x2, and y2, output whether a white king in chess (with coordinates (x1, y1)) could catch a black pawn (with coordinates (x2, y2)) and capture it if the pawn ...
827 views

### Play Antichess!

https://en.wikipedia.org/wiki/Losing_chess This is basically Chess Tournament, but for antichess ;) Antichess is one of the many chess variants that have been invented. The goal is to lose all your ...
388 views

### 8-bit Chess Pixel Counting

Goal You're playing a computerised chess game. The display is in black and white only and the pixels are chunky. White pixels use a lot power compared to black pixels and you're concerned about ...
6k views

### Determine the color of a chess square

Your challenge is to write a program that outputs the color of a given square from the chessboard. This is how a chessboard looks: You can see that the square a1 is dark, and h1 is a light square. ...
351 views

### Evaluating the score based from a chess FEN string

Challenge Forsyth–Edwards Notation (FEN) is a standard notation for describing a particular board position of a chess game. Your challenge is to evaluate the score using the FEN string. This is an ...
742 views

### N-queen-and-equine quine

There is a variant of the well-known N-queens problem which involves queens and knights and is said to be "considerably more difficult" 1. The problem statement is as follows: You must place an ...
199 views

### The Black Pawn's Revenge

Objective The black pawn wants revenge. Plot out its last attack. Rules The black pawn (L) starts at the top row and moves downwards to the bottom row. Maximise points taken, indicating the path ...
329 views

### The Attack of the Knights

Objective You have two knights on a standard chessboard labelled 1-8 and A-H, one knight is located at 1C and the other at 2G. You have to write a program in the language of your choosing that ...
949 views

### Capture on the Pawn Chessboard

You should write a program or function which receives a string representing a chessboard with only pawns as input and outputs or returns whether any capture is possible on the board. Input is in a ...
814 views

### ASCII Art Chessboard

In this challenge, you are to draw the chessboard below, and allow for moves to be made. 1. Drawing Each white square has 5x9 spaces. Each black square has 5x9 colons. The board is surrounded by a ...
451 views

### The lost pawn problem

The lost pawn problem After the chess game ended, a surviving pawn was left behind enemy lines. let's help him find the shortest way back home. The original problem describes a nXn "chess" board, ...
471 views

### Too many pawns on a chess board

Given an integer 2n, find the number of possible ways in which 2n^2 black pawns and 2n^2 white pawns can be arranged on a 2n by 2n chess board such that no pawn attack another. A black pawn can ...
510 views

### Explosions on a chessboard

Atomic chess is a (very fun) variant of chess in which every capture causes an "explosion," destroying the captured piece, the piece doing the capturing, and all non-pawns in a 1-square radius. The ...
349 views

### Stone Maze Chess solver [closed]

Background: Every war eventually comes to an end, but the end is never absolute. The Stone Maze Chess scenario takes place after a game of chess is finished. The enemy King is dead and the pieces is ...
2k views

### What is the Probability that a Knight Stays on Chessboard?

Given the size of the chess board and initial position of the knight, calculate the probability that after k moves the knight will be inside the chess board. Note: The knight makes its all 8 ...
1k views

### Smallest chess program

Inspired by this recent article telling of a French programmer who wrote a 487 byte 2-player (human vs. human) chess program in Assembly, I wondered how small chess programs could be in other ...
377 views

### Chess Light Solver

Challenge Write a solver for the Chess Light puzzle game, in the smallest amount of code. The input will be a representation of a chessboard, how in yours is up to you. My examples below is textual, ...
373 views

### Tic-Tac-Toe and Chess, with fewest [distinct] characteers

In this form of the game Tic-Tac-Chec, the goal is to move chess pieces to get four-in-a-row. Your goal here is to figure out if a position has a winning move. Rules The rules are similar, but not ...
2k views

### Chess Tournament

This is a chess-KOTH with simplified rules (because chess itself is already complicated, playing it via a simple program doesn't make it easier). At the moment it is limited to java (version 8), but ...
604 views

### Domination problem in chess

Given an mxm chess board, find a minimum number of pieces of the given kind and place them on a chess board in such a way that all squares are either occupied or attacked by at least one piece. Input ...
227 views

### Write the shortest code that bring to a solution of “The old curious knight with a lazy horse” problem [duplicate]

The Story: Once upon a time there was a curious Knight that lived on a never used chessboard in the Realm, an antique store. He spent all his career over there and when it came the moment of the ...
2k views

### Tell me the moves

Jack and Jane decided to play a game of chess to while away time. Unfortunately, Jack is rather bad at visualizing. He finds it tough to figure the moves possible for a given piece other than a pawn,...
1k views

### king + rook vs king

It's the ending of another well played chess game. You're the white player, and you still have a rook and your king. Your opponent only has his king left. Since you're white, it's your turn. Create a ...
3k views

### Smallest chess board compression

Write an algorithm or program that can encode and decode a chess board. The goal is to make the smallest representation of a chessboard that could be used (once decoded) to determine all movement ...
1k views

### n-queens problem, displaying more than one solution available

as some of you may know, n-queens problem is a set of algorithm puzzle that given a 'n x n' where n is the board size of a (let's say) chessboard, and the main goal is for the n queens (where n is the ...
611 views

### Simple chess bot

Inspired by this Implement simple chess bot (with console or GUI) that has following features: [Pseudo-]graphically showing the board; Accepting user moves and making their own moves; Playing by ...
383 views

### Chess960 position lookup

This is a follow-up to Chess960 position generator. In Chess960, there are 960 possible starting positions that can be enumerated from 0 to 959 (or, at your choice, from 1 to 960). The enumeration ...
716 views

### Chess960 position generator

Context Chess960 (or Fischer Random Chess) is a variant of chess invented and advocated by former World Chess Champion Bobby Fischer, publicly announced on June 19, 1996 in Buenos Aires, Argentina....
1k views

### Eight Queens Obsfucation [closed]

You've probably heard of the classic Eight Queens Puzzle. For those of you who haven't it goes something like this: Position 8 queens on an 8×8 chessboard so that no two queens threaten each ...
657 views

Write the shortest function that takes a two-dimensional square array representing the scores of a chess round, and outputs an array of the Neustadtl scores of the players. The two-dimensional array ...
1k views

### chess - calculate all legal moves from fen string ignoring castling and en passant

Write the shortest code that calculates all possible (legal) moves of current player from a given FEN string. What is FEN string? (Wikipedia) Shortest code wins, language doesn't matter. Output ...
525 views

### The smallest Chess arbiter

Write a program, which, upon gazing at a chess table, can say whether there is a check or a checkmate. Input: a chess table in text form, the last line of the input being the first rank (the starting ...
2k views

### A simple Knight's problem

How many ways are there to place a black and a white knight on an N * M chessboard such that they do not attack each other? A knight can move two squares horizontally and one square vertically, or ...
1k views

### Knight's tour on a rectangle

Given an a-by-b sized grid, and a chess knight, determine: A starting point and path the knight can take to visit every square in the grid or "NOT POSSIBLE", if not possible. Input: Two integers, ...
1k views

### Play a valid chess move, given a board on stdin

The program plays white. Example stdin: 8 ║♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜ 7 ║♟ ♟ ♟ ♟ … ♟ ♟ ♟ 6 ║… … … … … … … … 5 ║… … … … ♟ … … … 4 ║… … … … … … … … 3 ║… … ♘ … … … … … 2 ║♙ ♙ ♙ ♙ ♙ ♙ ♙ ♙ 1 ║♖ … ♗ ♕ ♔ ♗ ♘ ♖ ——╚════...
445 views

### Build a working chessboard

The challenge Create a program that mimics a chessboard. The datails The chessboard must be surrounded by the labels of each row and column, being the columns labeled from 'a' to 'h' and the rows ...
950 views

### Determining the winner of a Chess game

Challenge Being someone who plays far too much chess in his spare time, I thought I'd set a code golf challenge inspired by the game of chess (with a software flavour), for those interested. The ...
467 views

### Set the chessboard

Objective Given an arbitrary chessboard as standard input (in which each piece is on a square), produce as standard output a list of moves needed to regularize, or set up, the chessboard. The moves ...