A very simple engine in C/C++ using bitboards?
Moderators: hgm, Dann Corbit, Harvey Williamson
Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
A very simple engine in C/C++ using bitboards?
Hi all
Maybe someone here remembers Firstchess "FirstChess, a very simple open source chess program with a command line interface written by Nguyen Hong Pham (surname) in C for didactic purpose, introduced in 2002"
https://github.com/nguyenpham/FirstChess
I'm wondering whether something similar, written in C/C++ but with bitboards exists.
Thanks in advance
Emilio
Maybe someone here remembers Firstchess "FirstChess, a very simple open source chess program with a command line interface written by Nguyen Hong Pham (surname) in C for didactic purpose, introduced in 2002"
https://github.com/nguyenpham/FirstChess
I'm wondering whether something similar, written in C/C++ but with bitboards exists.
Thanks in advance
Emilio
Two first meanings of the dutch word "leren":
1. leren [vc] (learn, larn, acquire) acquire or gain knowledge or skills.
2. leren [v] (teach, learn, instruct) impart skills or knowledge to.
1. leren [vc] (learn, larn, acquire) acquire or gain knowledge or skills.
2. leren [v] (teach, learn, instruct) impart skills or knowledge to.
-
- Posts: 3694
- Joined: Wed Oct 01, 2008 4:33 am
- Location: Regensburg, Germany
- Full name: Guenther Simon
- Contact:
Re: A very simple engine in C/C++ using bitboards?
e.g. Winglet (original site does not exist anymore - thus the wayback link)pocopito wrote: ↑Mon Oct 01, 2018 1:35 pmHi all
Maybe someone here remembers Firstchess "FirstChess, a very simple open source chess program with a command line interface written by Nguyen Hong Pham (surname) in C for didactic purpose, introduced in 2002"
https://github.com/nguyenpham/FirstChess
I'm wondering whether something similar, written in C/C++ but with bitboards exists.
Thanks in advance
Emilio
http://web.archive.org/web/201206211002 ... m/winglet/
https://rwbc-chess.de
Greg Strong@ovyron wrote: http://talkchess.com/forum3/viewtopic.p ... 86#p752386
-
- Posts: 770
- Joined: Mon Jul 17, 2006 3:53 am
- Full name: Edsel Apostol
- Contact:
Re: A very simple engine in C/C++ using bitboards?
You can try this one. This is when I'm just starting to learn programming in College.pocopito wrote: ↑Mon Oct 01, 2018 1:35 pmHi all
Maybe someone here remembers Firstchess "FirstChess, a very simple open source chess program with a command line interface written by Nguyen Hong Pham (surname) in C for didactic purpose, introduced in 2002"
https://github.com/nguyenpham/FirstChess
I'm wondering whether something similar, written in C/C++ but with bitboards exists.
Thanks in advance
Emilio
https://github.com/ed-apostol/TwistedLo ... /Logic18.c
Edsel Apostol
https://github.com/ed-apostol/InvictusChess
https://github.com/ed-apostol/InvictusChess
-
- Posts: 11929
- Joined: Wed Mar 08, 2006 7:57 pm
- Location: Redmond, WA USA
- Contact:
Re: A very simple engine in C/C++ using bitboards?
Olithink.pocopito wrote: ↑Mon Oct 01, 2018 1:35 pmHi all
Maybe someone here remembers Firstchess "FirstChess, a very simple open source chess program with a command line interface written by Nguyen Hong Pham (surname) in C for didactic purpose, introduced in 2002"
https://github.com/nguyenpham/FirstChess
I'm wondering whether something similar, written in C/C++ but with bitboards exists.
Thanks in advance
Emilio
From here:
http://brausch.org/home/chess/index.html
This link:
http://brausch.org/home/chess/OliThink533.src.zip
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
Re: A very simple engine in C/C++ using bitboards?
Check out Teki:
https://github.com/Mk-Chan/Teki
It uses the classical bitboard approach (non-magic/rotated).
https://github.com/Mk-Chan/Teki
It uses the classical bitboard approach (non-magic/rotated).
Re: A very simple engine in C/C++ using bitboards?
Thanks for this linkGuenther wrote: ↑Mon Oct 01, 2018 2:50 pme.g. Winglet (original site does not exist anymore - thus the wayback link)pocopito wrote: ↑Mon Oct 01, 2018 1:35 pmHi all
Maybe someone here remembers Firstchess "FirstChess, a very simple open source chess program with a command line interface written by Nguyen Hong Pham (surname) in C for didactic purpose, introduced in 2002"
https://github.com/nguyenpham/FirstChess
I'm wondering whether something similar, written in C/C++ but with bitboards exists.
Thanks in advance
Emilio
http://web.archive.org/web/201206211002 ... m/winglet/
I started to try to follow the steps
I have some problem in step 5.
int _tmain(int argc, _TCHAR* argv[])
{
printf("hello, I am your new friend!\n");
return 0;
}
This code produce errors when I compile it.
Severity Code Description Project File Line Suppression State
Error (active) E0020 identifier "_TCHAR" is undefined chess_project C:\Users\UriBlass\source\repos\chess_project\chess_project\main.cpp 2
Severity Code Description Project File Line Suppression State
Error (active) E0020 identifier "printf" is undefined chess_project C:\Users\UriBlass\source\repos\chess_project\chess_project\main.cpp 5
Note that
I have no errors with the following code that does what it is supposed to do and maybe the code that they suggest is only relevant for visual C++2010 and not for visual C++2017.
#include <iostream>
int main()
{
printf("hello, I am your new friend!\n");
return 0;
}
Edit:
I guess that the following comment in step 5 is also not relevant for people who use Visual C++ 2017
"Visual Studio C++ Express does not come with 64-bit compilers.
If you want to build your executable for a 64-bit platform, then I suggest searching the internet for "how to configure Visual C++ Projects to Target 64-Bit Platforms". This will lead you to Microsoft's site with more information. "
Am I right?
Re: A very simple engine in C/C++ using bitboards?
I personally don't recommend that tutorial because it's focused on programming in Windows, also it's outdated, the code it's too repetitive and mix c with c++Uri Blass wrote: ↑Tue Oct 02, 2018 10:19 pmThanks for this linkGuenther wrote: ↑Mon Oct 01, 2018 2:50 pme.g. Winglet (original site does not exist anymore - thus the wayback link)pocopito wrote: ↑Mon Oct 01, 2018 1:35 pmHi all
Maybe someone here remembers Firstchess "FirstChess, a very simple open source chess program with a command line interface written by Nguyen Hong Pham (surname) in C for didactic purpose, introduced in 2002"
https://github.com/nguyenpham/FirstChess
I'm wondering whether something similar, written in C/C++ but with bitboards exists.
Thanks in advance
Emilio
http://web.archive.org/web/201206211002 ... m/winglet/
I started to try to follow the steps
I have some problem in step 5.
int _tmain(int argc, _TCHAR* argv[])
{
printf("hello, I am your new friend!\n");
return 0;
}
This code produce errors when I compile it.
Severity Code Description Project File Line Suppression State
Error (active) E0020 identifier "_TCHAR" is undefined chess_project C:\Users\UriBlass\source\repos\chess_project\chess_project\main.cpp 2
Severity Code Description Project File Line Suppression State
Error (active) E0020 identifier "printf" is undefined chess_project C:\Users\UriBlass\source\repos\chess_project\chess_project\main.cpp 5
Note that
I have no errors with the following code that does what it is supposed to do and maybe the code that they suggest is only relevant for visual C++2010 and not for visual C++2017.
#include <iostream>
int main()
{
printf("hello, I am your new friend!\n");
return 0;
}
Edit:
I guess that the following comment in step 5 is also not relevant for people who use Visual C++ 2017
"Visual Studio C++ Express does not come with 64-bit compilers.
If you want to build your executable for a 64-bit platform, then I suggest searching the internet for "how to configure Visual C++ Projects to Target 64-Bit Platforms". This will lead you to Microsoft's site with more information. "
Am I right?
I learned chess programming and C programming watching the VICE series (the source code it's a bit a mess but at the end you will learn), it's developed in C99, you can develop C99 in Visual Studio with just changing the source files to .c VS will compile as C code (since VS 2013 support C99) VS 2017 seems to still support C99, just using a few macros you can get a fully functional chess program in Windows, Linux and macOS
Skiull http://skiull.blogspot.com
-
- Posts: 770
- Joined: Mon Jul 17, 2006 3:53 am
- Full name: Edsel Apostol
- Contact:
Re: A very simple engine in C/C++ using bitboards?
Try also this one. My early versions from 2005. This is a working xboard engine:pocopito wrote: ↑Mon Oct 01, 2018 1:35 pmHi all
Maybe someone here remembers Firstchess "FirstChess, a very simple open source chess program with a command line interface written by Nguyen Hong Pham (surname) in C for didactic purpose, introduced in 2002"
https://github.com/nguyenpham/FirstChess
I'm wondering whether something similar, written in C/C++ but with bitboards exists.
Thanks in advance
Emilio
https://github.com/ed-apostol/TwistedLo ... c/omega9.c
Edsel Apostol
https://github.com/ed-apostol/InvictusChess
https://github.com/ed-apostol/InvictusChess
Re: A very simple engine in C/C++ using bitboards?
[/quote]
Try also this one. My early versions from 2005. This is a working xboard engine:
https://github.com/ed-apostol/TwistedLo ... c/omega9.c
[/quote]
This one doesn't compile
$ gcc -o omega9 omega9.c
omega9.c: In function ‘gettime’:
omega9.c:533:5: warning: implicit declaration of function ‘_ftime’; did you mean ‘ftime’? [-Wimplicit-function-declaration]
_ftime(&tv);
^~~~~~
ftime
omega9.c:534:15: error: invalid use of undefined type ‘struct _timeb’
return (tv.time * 1000 + tv.millitm);
^
omega9.c:534:32: error: invalid use of undefined type ‘struct _timeb’
return (tv.time * 1000 + tv.millitm);
^
omega9.c: In function ‘displayb’:
omega9.c:927:14: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long int’ [-Wformat=]
printf("%d.%s%s c: %d castle: %d ep square: %d eval: %d fifty: %d \n",
~^
%ld
(status - H) / 2 + (o ? 1 : 0), o ? " " : " ...", displaymove((status - 1)->m),
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
omega9.c: At top level:
omega9.c:148:15: error: storage size of ‘tv’ isn’t known
struct _timeb tv;
^~
Try also this one. My early versions from 2005. This is a working xboard engine:
https://github.com/ed-apostol/TwistedLo ... c/omega9.c
[/quote]
This one doesn't compile
$ gcc -o omega9 omega9.c
omega9.c: In function ‘gettime’:
omega9.c:533:5: warning: implicit declaration of function ‘_ftime’; did you mean ‘ftime’? [-Wimplicit-function-declaration]
_ftime(&tv);
^~~~~~
ftime
omega9.c:534:15: error: invalid use of undefined type ‘struct _timeb’
return (tv.time * 1000 + tv.millitm);
^
omega9.c:534:32: error: invalid use of undefined type ‘struct _timeb’
return (tv.time * 1000 + tv.millitm);
^
omega9.c: In function ‘displayb’:
omega9.c:927:14: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long int’ [-Wformat=]
printf("%d.%s%s c: %d castle: %d ep square: %d eval: %d fifty: %d \n",
~^
%ld
(status - H) / 2 + (o ? 1 : 0), o ? " " : " ...", displaymove((status - 1)->m),
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
omega9.c: At top level:
omega9.c:148:15: error: storage size of ‘tv’ isn’t known
struct _timeb tv;
^~
Two first meanings of the dutch word "leren":
1. leren [vc] (learn, larn, acquire) acquire or gain knowledge or skills.
2. leren [v] (teach, learn, instruct) impart skills or knowledge to.
1. leren [vc] (learn, larn, acquire) acquire or gain knowledge or skills.
2. leren [v] (teach, learn, instruct) impart skills or knowledge to.
Re: A very simple engine in C/C++ using bitboards?
Compiles without errors with MinGW GCC 5.3.0 into a.exe -- attached.
- Attachments
-
- TwistedLogic-omega9.zip
- Twisted Logic omega9
- (28.17 KiB) Downloaded 122 times
Tirsa Poppins
CCRL
CCRL