Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
chess_programming
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Radia EL HAMDOUNI
chess_programming
Commits
f32479bd
Commit
f32479bd
authored
Oct 28, 2020
by
Radia EL HAMDOUNI
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added fen notation
parent
e93caa1c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
0 deletions
+49
-0
fen.c
fen.c
+49
-0
No files found.
fen.c
0 → 100644
View file @
f32479bd
#include<stdio.h>
int
side
;
void
fen
(
char
*
my_fen
){
// first reset the board
reset
();
for
(
int
i
=
0
;
i
<
8
;
i
++
){
//loop over the ranks
for
(
int
j
=
0
;
j
<
16
;
j
++
){
// loop over the files
int
square
=
16
*
i
+
j
;
// first part of fen
if
(
!
(
square
&
0x88
)){
if
((
*
my_fen
>=
'a'
&&
*
my_fen
<=
'z'
)
||
(
*
my_fen
>=
'A'
&&
*
my_fen
<=
'Z'
)
){
board
[
square
]
=
char_pieces
[
*
my_fen
];
*
my_fen
++
;
}
if
(
*
my_fen
>=
'0'
&&
*
my_fen
<=
'8'
){
j
+=
*
my_fen
-
'0'
;
*
my_fen
++
;
}
if
(
*
my_fen
==
'/'
){
*
my_fen
++
;
}
}
}
}
*
my_fen
++
;
// second part of FEN
if
(
*
my_fen
==
'w'
){
side
=
white
;
}
else
{
side
=
black
;
}
show_board
();
// castling
// en passant
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment