This is cool, I like it.
One thing that would help is if you used the preprocessor more. You have
lots of instances of things like "if (i & 32) ...", and you'll do things like
have a switch statement where the selector is a board index, and you'll have
things like "case 60:". It would be more readable if you covered these with
#defines, for instance "if (i & PROMOTES) ..." and "case E8:".
bruce
Cheers,
Tom
brucemo (bru...@seanet.com) wrote:
Cheers,
Tom
Tom Kerrigan wrote in article <5srnqt$972$1...@europa.frii.com>...
First let me say thanks Tom for doing this...I hope to learn alot from
examining the code. I was unable to compile the program with Microsoft's
compiler (several errors and warnings) but used an old Borland Turbo C++
compiler for DOS. It compiled with one warning concerning the in_check
function (sorry didn't write it down).
I then tried playing a game which went .......
1. d4 Rxg8 and I didn't bother playing any further!
the line it was examining was something like (from memory) 1... Rxg8 2.
Rxb1 d5 after which it gave a score of -24......... Is there a problem in
the legal move testing?
Tim
Tom Kerrigan wrote:
>
> This is just a post to announce that I'm done with TSCP, and you can find
> the sources at my homepage, http://www.frii.com/~kerrigan It's a "heavily"
> commented program that's around 1,000 lines long, written for readability.
> I think beginners will find it quite useful.
Hi TK!
Just grabebd it - much thanks - I like tinkering and trying to learn
from these critters (I seem to be in the DOLT category of chess
programmers).
Perhaps ONE little suggestion - a README.TXT file with a brief
overview of the program?
Thanksa gain! Ep
Ed Parry - au...@lafn.org
I do the work of three men - Moe, Larry & Curly
Borland Turbo C compilers do have 16bit ints only. You will have to
use long ints. Search and replace or use the preprocessor for this...
Martin
P.S.: It does play chess:
gics%
Statistics for TSCP (Last disconnected Thu Aug 14 1997, 18:02 MET
DST):
rating RD win loss draw total best
Blitz 1507 88.7 48 9 2 59 1718 (14-Aug-97)
Standard ---- 350.0 0 0 0 0
Lightning 1824 112.0 3 9 1 13
Wild ---- 350.0 0 0 0 0
Bughouse ---- 350.0 0 0 0 0
Atomic ---- 350.0 0 0 0 0
Suicide ---- 350.0 0 0 0 0
1: Tom Kerrigan's Simple Chess Programm
Probably something like warning for in_check() being able to return
nothing at all, which can be discarded. If this is the warning,
speed up the program and remove the warning by diking out the
i<64 test in the for-loop. This way you replace the bounded
linear king search by a plain linear search.
I'm getting tons of warnings when I compile it, but most seem
pretty harmless.
> I then tried playing a game which went .......
> 1. d4 Rxg8 and I didn't bother playing any further!
> the line it was examining was something like (from memory) 1... Rxg8 2.
> Rxb1 d5 after which it gave a score of -24......... Is there a problem in
> the legal move testing?
For the strange game: My guess is that your compiler somehow
uses 16 bit ints. The program assumes an int is wider than that.
See if your compiler has an option to switch to 32 bit ints.
The program is way cool as a beginners aid, I must say.
Marcel
-- _ _
_| |_|_|
|_ |_ mar...@stack.nl
|_| Marcel van Kervinck
Tim
Martin Borriss <bor...@inf.tu-dresden.de> wrote in article
<5t1720$aom$1...@os.inf.tu-dresden.de>...
> In article <tj20t5...@unox.hak.nl>,
> Marcel van Kervinck <mar...@unox.hak.nl> writes:
> >For the strange game: My guess is that your compiler somehow
> >uses 16 bit ints. The program assumes an int is wider than that.
> >See if your compiler has an option to switch to 32 bit ints.
> >
> >The program is way cool as a beginners aid, I must say.
>
take care.
Hristo
Tim F. Ginnett wrote in article
<01bca8b8$fb560a20$693b...@t-ginnett.tamu.edu>...
>My game against Tom Kerrigan's Simple Chess Program..
>
>First let me say thanks Tom for doing this...I hope to learn alot from
>examining the code. I was unable to compile the program with Microsoft's
>compiler (several errors and warnings) but used an old Borland Turbo C++
>compiler for DOS. It compiled with one warning concerning the in_check
>function (sorry didn't write it down).
>
>I then tried playing a game which went .......
>
>1. d4 Rxg8 and I didn't bother playing any further!
>
>the line it was examining was something like (from memory) 1... Rxg8 2.
>Rxb1 d5 after which it gave a score of -24......... Is there a problem in
>the legal move testing?
>
>Tim
>
>
>
>> First let me say thanks Tom for doing this...I hope to learn alot from
>> examining the code. I was unable to compile the program with Microsoft's
>> compiler (several errors and warnings) but used an old Borland Turbo C++
>> compiler for DOS. It compiled with one warning concerning the in_check
>> function (sorry didn't write it down).
Agreed - Thanks go out to TK for offering this critter openly. VERY
nicely done.
Compilers - So far - Quick C v2.5 and MSC60 seem to do fine for me. No
warning or errors and it runs fine. When I use Turbo C v2.0 or
Borlands C++ v3.1 (standard DOS EXE outout) TSCP starts replacing
pieces on teh board. TK suggested that it might not be a 32 bit
compiler, but I do not recall that Quick C v2.5/MSC60 is either - at
least not without me directing it to be. Anyways, I am stuck - I
tinkered alot with the Borland compilers but could not solve the
problem. Adding #define int long causes a TOO MUCH GLOBAL DATA error;
I even tried using the HUGE memory model and a project file to compile
and link the file individually (I made them all into one 30k soruce
file). Quick C just chugs thru the file (without the #define int long)
and works well. Just has me all perplexed.
Have yet to try it with any other compilers such as Power C v2.0 or
DJGPP v2.x, etc.
>I'm getting tons of warnings when I compile it, but most seem
>pretty harmless.
You can kill certain warnings in Borland compilers - things like:
FUNCTION DOES NOT RETURN A VALUE
and
IDENTIFIER 'ident' IS NOT USED IN FUNCTION xxxxxx
can be turned off. I had to do this to get GenChess.C to compile with
Turbo C v2.0.
I do recall a CONSTANT IS LONG error in TC/BC and I shut it off. I'll
have to recheck - perhaps this is where I would need to change a few
int defines to long's orperhaps the LONG is getting chanegd to an int
in the final program. ie: Still intend to to tinker with it.
>> I then tried playing a game which went .......
>> 1. d4 Rxg8 and I didn't bother playing any further!
Sounds ALOT like my problem(s) with TSCP. I think it IS the 16 vs 32
bit problem, but for Borlands compilers I've not found a solution yet.
IF I do, I'll post it. I suspect DJGPP
>> the line it was examining was something like (from memory) 1... Rxg8 2.
>> Rxb1 d5 after which it gave a score of -24......... Is there a problem in
>> the legal move testing?
No - I think this is the lack of 32 bits for the bitboards based legal
move generator.
>The program is way cool as a beginners aid, I must say.
I second that! Nice job and thanks TK! Ed
Tom, your new chess baby is fantastic. Better watch out. The tower of
Babel that is the r.g.c.c. will make sure that it grows and grows. It
may even take over Stobor some day.
--
Best regards
Komputer Korner
The inkompetent komputer
If you see a 1 in my email address, take it out.
Note that my true email is still kor...@netcom.ca
I don't often check the email of the sympatico address.
Ed Parry <au...@lafn.org> wrote in article
<33f60c1c...@news.lafn.org>...
> On Fri, 15 Aug 1997 00:59:09 +0200, Marcel van Kervinck
> <mar...@unox.hak.nl> wrote:
>
> >> First let me say thanks Tom for doing this...I hope to learn alot from
> >> examining the code. I was unable to compile the program with
Microsoft's
> >> compiler (several errors and warnings) but used an old Borland Turbo
C++
> >> compiler for DOS. It compiled with one warning concerning the in_check
> >> function (sorry didn't write it down).
>
> Agreed - Thanks go out to TK for offering this critter openly. VERY
> nicely done.
>
> Compilers - So far - Quick C v2.5 and MSC60 seem to do fine for me. No
> warning or errors and it runs fine. When I use Turbo C v2.0 or
> Borlands C++ v3.1 (standard DOS EXE outout) TSCP starts replacing
> pieces on teh board. TK suggested that it might not be a 32 bit
> compiler, but I do not recall that Quick C v2.5/MSC60 is either - at
> least not without me directing it to be. Anyways, I am stuck - I
> tinkered alot with the Borland compilers but could not solve the
> problem. Adding #define int long causes a TOO MUCH GLOBAL DATA error;....
I had the same problem until last night. Using the preprocessor to
redefine int (#define int long) did not work. However, for some reason
when I explicitly replaced every instance of 'int' with 'long' I got a
compiled version that works. I do have a question though.....the scores
that it gives after each ply seems mysterious..... e.g.
ply score
1 24
2 115
3 1153
4 12563
Do I have another compiler problem? The program seems to be making logical
chess moves now.
Tim
>On Fri, 15 Aug 1997 00:59:09 +0200, Marcel van Kervinck
><mar...@unox.hak.nl> wrote:
>>> First let me say thanks Tom for doing this...I hope to learn alot from
>>> examining the code. I was unable to compile the program with Microsoft's
>>> compiler (several errors and warnings) but used an old Borland Turbo C++
>>> compiler for DOS. It compiled with one warning concerning the in_check
>>> function (sorry didn't write it down).
>Agreed - Thanks go out to TK for offering this critter openly. VERY
>nicely done.
I missed the original post. Where can I get the program?
Does anyone know where this !@#$%! six wheeled robot came from?
>My game against Tom Kerrigan's Simple Chess Program..
(snip)
>1. d4 Rxg8 and I didn't bother playing any further!
Why not? The program sacrificed the exchange on the
first move!
8-)
Dan
Dan
>This is just a post to announce that I'm done with TSCP, and you can find
>the sources at my homepage, http://www.frii.com/~kerrigan. It's a "heavily"
>commented program that's around 1,000 lines long, written for readability.
>I think beginners will find it quite useful.
>Cheers,
>Tom
On Wed, 20 Aug 1997 11:18:13 -0400, Marc Thornton <ma...@bon.net>
wrote:
>Marcel van Kervinck wrote:
>>
>> Tim F. Ginnett <t-gi...@tamu.edu(REMOVE THIS)> wrote:
>> > First let me say thanks Tom for doing this...I hope to learn alot from
>> > examining the code. I was unable to compile the program with Microsoft's
>> > compiler (several errors and warnings) but used an old Borland Turbo C++
>> > compiler for DOS. It compiled with one warning concerning the in_check
>> > function (sorry didn't write it down).
>>
>
>
>Hey, Where can I get simple chess at??? I have been trying to find it
>but am having trouble...
>
>
>thanks,
>
>
> marc...