Questions tagged [fen]

Forsyth–Edwards Notation (FEN) is a standard notation for describing a board position of a chess game. The purpose of FEN is to provide all the necessary information to restart a game from a particular position.

A FEN string defines a particular game position, all in one text line and using only the ASCII character set.

A text file with only FEN data records should have the file extension .fen.

One FEN string consists of six fields separated by a space character:

<FEN> ::=  <Piece Placement>
       ' ' <Side to move>
       ' ' <Castling ability>
       ' ' <En passant target square>
       ' ' <Halfmove clock>
       ' ' <Fullmove counter>

Further details:

  1. Chess programming
  2. Wikipedia
29 questions
0
votes
1 answer

How can I improve my Haskell code and make it work?

In my code I call the validateFEN function with a FEN String. A Fen string looks like this for…
Snusqx
  • 45
  • 5
0
votes
1 answer

Stockfish giving contradictory results on perft funtion

I'm working on a Unity chess program and I'm using stockfish to debug my moves generation algorithm by comparing the perft function results. On this position (8/2p5/3p4/1P5r/1K5k/5p2/4P1P1/1R6 b - - 0 1) with a depth of 2, Stockfish gives this…
0
votes
1 answer

Iterating String.split() working differently than I expected

I am writing a simple javascript code to parse, and verify a chess position written in Forsyth–Edwards Notation (FEN). The default chess position in this notation is given by, const defaultFEN = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq -…
0
votes
1 answer

how to get the FEN out of unNested chess board List

I made a chess Program.py that is not working fine; I want to gen the FEN out of the board list that looks like this board = [ "R", "N", "B", "K", "Q", "B", "N", "Q", "P", "P", "P", "P", "P", "P", "P", "P", " ", " ", " ", "…
0
votes
1 answer

Removing a String from an Array, but adding the Number amount back in Javascript

I am trying to create a FEN notation converter for chess. I've decided the best way to go about this is to remove any unnecessary values from the string that I don't need. Here is what it looks like. rnbqkbnr/pppppppp/8/ These are all strings in my…
4156
  • 380
  • 4
  • 17
0
votes
1 answer

Cumulative application of a gsub sequence in R

I'm working on a project dealing with chess games. After some processing of the data I need to get the FEN (https://en.wikipedia.org/wiki/Forsyth%E2%80%93Edwards_Notation) notation of a particular position. I've already written the code for each…
y154707
  • 93
  • 5
0
votes
2 answers

how to modify a fen string in java?

So i have this string StringBuilder fenToString = new StringBuilder("1P111Pr1") now how can i change it to a = "1P3Pr1"? i tried this int fenNum = 0; for(int i = 0; i < fenToString.length(); i++){ …
fauxxi
  • 75
  • 10
0
votes
1 answer

Php apply function in array if next entry is integer (Concatenate a valid FEN string)

Trying to build a valid FEN string. Given this 8*8 array example, symbolizing a checker board, ("1" are empty squares): $checkerboard =…
NVRM
  • 11,480
  • 1
  • 88
  • 87
0
votes
0 answers

ifstream doesn't seem to open an external exe for reading and writing

I am a beginner hobby programmer. I am working on a small program that will take the FEN string of any chess position from the user, pass it into the Stockfish chess engine, and grab a move output from the exe once it has done its magic in finding…
0
votes
2 answers

How to generate a FEN-string and send it to Stockfish?

I am building a chess GUI, which is supposed to talk to Stockfish. I have heard that I have to generate a FEN-string, to tell Stockfish about the move that has been made. So the question is, how do I do this? I have really met a dead end here.. I am…
user9614716
0
votes
1 answer

Chess.js does not detect stalemate

For the given fen string - k7/1R1RN3/p3p3/P3P2p/1PP4P/3K1PP1/8/8 b KQkq h3 0 1 Chess.js does not detect and show chess.moves() gives you ['0-0-0'], which is queen side castling, Not possible without a queen. Any idea?
Hardeep Mehta
  • 469
  • 1
  • 6
  • 17
0
votes
1 answer

compare two FEN string to prevent impossible positions in chess

I implemented a chessboard with chessboard.js and when position change the FEN string is sending to my node.js server using socket.io The question is, How i can prevent illegal moves or how i can find FEN is possible in every move situation?
Vahid Alimohamadi
  • 4,900
  • 2
  • 22
  • 37
0
votes
1 answer

RabbitPlugin for DGT eboard not displaying complete FEN notation

Has anyone worked with RabbitPlugin DLL for the DGT e-board before? I am able to detect moving chess pieces from the board and it's giving me an FEN String but it's not giving the complete FEN notation (please see below). Can anyone provide help on…
dimas
  • 2,487
  • 6
  • 40
  • 66
-1
votes
1 answer

generating FEN string from reed sensor chess board and only getting next best move from stockfish engine

I am building a chess playing robot, so after getting an 8x8 matrix of 1's and 0's from the reed switch sensors, how do I convert this matrix to a FEN string so that I can send this to the Stockfish engine? Also, I am having a lot of trouble in…
Roshan
  • 111
  • 5
1
2