Chess2u
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Chess2uLog in

SecondChess

descriptionSecondChess - Page 3 EmptySecondChess video on youtube

more_horiz
Hi Emilio
I have done a video for my last game versus secondchessW32 on my chess youtube at https://www.youtube.com/watch?v=1X2Jqmwo8jY&feature=plcp

(I see you have recently updated both secondchess & secondchessW32 since I last downloaded the files-I look forward to checking these out when I can).

To Richard_1977
Thanks for your diagram...helps understanding secondchess function relations :-)

descriptionSecondChess - Page 3 EmptyRe: SecondChess

more_horiz
It's nice to see people having fun with secondchess :)

The introduction you do in the video is quite clear, and by the way, good game!

Regards

Emilio

descriptionSecondChess - Page 3 EmptyRe: SecondChess

more_horiz
@richardpd wrote:
I have done a video for my last game versus secondchessW32 on my chess youtube at https://www.youtube.com/watch?v=1X2Jqmwo8jY&feature=plcp

Good game richard. smile

descriptionSecondChess - Page 3 EmptyRe: SecondChess

more_horiz
Doesn't work under Fritz-GUI, is it a winboard engine? does it mean I have to use WB2UCI adapter?

descriptionSecondChess - Page 3 EmptyRe: SecondChess

more_horiz
Hi Ahmed

Thanks for trying Secondchess. Unfortunatly I do most of my develop job under linux and I don't have any experience trying to run it on frizt GUI.

I guess that people who've tryed it under Windows have been able to play against it under Arena GUI.

On the other hand, if your interest is to study and modify its code (which actually is Secondchess' aim), you always can execute your compilations from an ms-dos terminal.

Regards

Emilio

descriptionSecondChess - Page 3 EmptyRe: SecondChess

more_horiz
Yes. Runs fine under Arena 3 ! Thanks Emilio.

descriptionSecondChess - Page 3 EmptyRe: SecondChess

more_horiz
does anyone could put the wb2uci adapter .. and post a link .. please .. best

descriptionSecondChess - Page 3 EmptyRe: SecondChess

more_horiz
@mcdiniz wrote:
does anyone could put the wb2uci adapter .. and post a link .. please .. best

mediafire.com ?8j8lckm29ms786m

descriptionSecondChess - Page 3 EmptyRe: SecondChess

more_horiz
tks.. jnhes.. could someone put together with the program .. 'm not able to do that ... best

descriptionSecondChess - Page 3 EmptyRe: SecondChess

more_horiz
SecondChess - Page 3 Logogr10

SecondChess 0.1.79
https://github.com/pocopito/secondchess/zipball/master

descriptionSecondChess - Page 3 EmptyRe: SecondChess

more_horiz
tks..

descriptionSecondChess - Page 3 EmptyRe: SecondChess

more_horiz
Hi Emilio
Happy New Year to you...
I've just tried compiling latest SecondChess from GitHub in my GeanyforWindows (TDM compiler)but no compile & get these errors:
g++ -m32 secondchess.c -o secondchess.exe (in directory: C:\)
secondchess.c: In function 'int GenMoves(int, MOVE*)':
secondchess.c:576:28: error: 'IsInCheck' was not declared in this scope
secondchess.c:577:36: error: 'IsAttacked' was not declared in this scope
secondchess.c:591:28: error: 'IsInCheck' was not declared in this scope
secondchess.c:592:36: error: 'IsAttacked' was not declared in this scope
secondchess.c:609:28: error: 'IsInCheck' was not declared in this scope
secondchess.c:610:36: error: 'IsAttacked' was not declared in this scope
secondchess.c:624:28: error: 'IsInCheck' was not declared in this scope
secondchess.c:625:36: error: 'IsAttacked' was not declared in this scope
secondchess.c: In function 'int IsInCheck(int)':
secondchess.c:946:37: error: 'IsAttacked' was not declared in this scope
secondchess.c: In function 'int Search(int, int, int, MOVE*)':
secondchess.c:1472:37: error: 'Quiescent' was not declared in this scope
secondchess.c: At global scope:
secondchess.c:1652:8: error: 'depth' was not declared in this scope
secondchess.c:1653:1: error: expected ',' or ';' before '{' token
Compilation failed.


Why do I get these errors & how do I declare IsInCheck & IsAttacked & fix these errors please?

descriptionSecondChess - Page 3 EmptyRe: SecondChess

more_horiz
Hi richardpd
You are using g++. Try with gcc.
Anyway is lacking a "int" in line 1652

perft (int depth)

descriptionSecondChess - Page 3 EmptyRe: SecondChess

more_horiz
I note the bug in line 1652.

On the other hand I guess it'd be a good idea to add some info about compiling under windows on the README.

Thanks to all who use the code and who comment on this post!

Best regards

Emilio

descriptionSecondChess - Page 3 EmptyRe: SecondChess

more_horiz
Hi AGu & Emilio

Many thanks for your quick & helpful replies.
I have been using GeanyforWindows with MinGW to compile C/C++ programs on my Win7 desktop but for some reason a few weeks ago this stopped working for me & I installed TDM-GCC which I use in GeanyforWindows (this uses g++ -m32 secondchess.c -o secondchess.exe cmd line by default).

However by compiling in Windows cmd prompt instead with gcc I can get secondchess.c to compile (eg C:\RPD_Programming_Computing\RPD_Chess_programming\secondchess>gcc secondchess.c -o secondchess
C:\RPD_Programming_Computing\RPD_Chess_programming\secondchess>).

I am still learning C & this has been a lesson (different outputs for gcc & g++). I hope to learn more about C programming from SecondChess source code this year. Watchout I'll probably be posting asking for help! :-)

Best wishes to you both

descriptionSecondChess - Page 3 Emptycontinuar in xboard function?

more_horiz
Hi Emilio
I'm taking a further closer look at SecondChess and am a little confused in the xboard function with the use of the name continuar? Is this Spanish for continue?

This is the code I see in secondchess.c (xboard function):

Code:


if (MakeMove (moveBuf[i]))
     {
 goto continuar; /* legal move */
 }
 else {
 printf ("Illegal move. King is in check\n");
 goto continuar;
 }
}
  }
      printf ("Illegal move.\n");  /* illegal move */
      
continuar:
  continue;
 }
}


What do the expressions "goto:continuar; and continuar:continue;" mean here? Is this correct (or if it is in Spanish what is the correct expression in English? Can I use an English word here for continuar? If so would I use continue? This is confusing to me!).

I'm grateful if you could explain this, many thanks

*EDIT*
Perhaps I can try using a substitute English word for continuar here such as "continuing"? I'll try this-perhaps this issue is of very little matter, but it just surprised me to find a Spanish word here! You are probably a Spanish speaker as well as an English one. There seem to be several Spanish chess engines around (eg Xadreco & Danasah I think & maybe this continuar word is left over from their xboard functions?).
After all this I just realise continue is a C keyword (so I cannot use continue:continue...makes no sense to me..maybe I will use goto continuing; continuing:continue;)

*FURTHER EDIT* If I use continuing instead of continuar all is well! eg "goto continuing;" & "continuing:continue;"  All sorted-please disregard this post now! :-)

Hola (!) & Best wishes :-)

descriptionSecondChess - Page 3 EmptyRe: SecondChess

more_horiz
Hi Richard


Yes, "continuar" is the Spanish for "to continue".

The reason why it's in Spanish is that this part of the code was a generous aportation of a Spanis mate. Probably I just didn't realize the language inconsistency I was introucing at the time I added the code.

I'll just correct it on the repository, as I think this is the proper thing to do in order to keep the code readable in English.

Many thanks for noting it!


 Best

     Emilio

EDIT: already updated on the github repo.

Last edited by pocopito on Mon Dec 16, 2013 12:58 pm; edited 1 time in total (Reason for editing : Update info)

descriptionSecondChess - Page 3 EmptyGithub repo update

more_horiz
Emilio

Thanks for your prompt & helpful reply & for updating the code at secondchess github repository.

I see the github repo url/address has changed from the link given on the first page of this thread eg:

SecondChess Github link: SecondChess Github link

(NOT: https://github.com/pocopito/secondchess ..... this link is NOT working).

Thanks and best wishes

descriptionSecondChess - Page 3 EmptyPrint a move history list for SecondChess?

more_horiz
Hi Emilio
I would like to add code to print out the move history after each player turn and would appreciate your help on how I can do this. Moves appear to be stored in

Code:
HIST hist [6000];

array.

If I print this array will that work? If so how do I print out this array? Everything I have tried to print this has failed! For example:

Code:

int a=0; //a=loopcounter
for (a=0;a<=6000;a++){
printf("Move history list:%d",hist[a]);
}


If I put this in main just below printf ("CASTLE: %d\n", castle); then the code above compiles but with a warning:
rpdsecondchess.c:1978:1: warning: format %d expects argument of type int , but argument 2 has type HIST [-Wformat=]

and on entering a move I get garbage output at cmd console!

I am most grateful for any help you can give so I can print the moves as a move history list out to screen. I look forward to your reply, many thanks

descriptionSecondChess - Page 3 EmptyRe: SecondChess

more_horiz
Hi richardpd

I guess you have to take a look at the "structure" lesson on a C manual.

hist is an array structures of type HIST. HIST structure is defined as:
/* For storing all moves of game */
typedef struct tag_HIST
{
 MOVE m;
 int castle;
 int cap;
} HIST;

One of the members of HIST is "m", the move that was played to reach that  position.

If you pay attention you'll see that "m" itself is a structure of type MOVE, which is defined as:
/* A move is defined by its origin and final squares, the castle rights and the kind of
* move it's: normal, enpasant... */
typedef struct tag_MOVE
{
 int from;
 int dest;
//      int castle;
 int type;
} MOVE;

So in order to print the full moves you have to access the "from" and "dest" members of each move. BTW, take into account:
-That although hist is defined with size 6000 it only makes sense to read the info till the current move (besides if you print 6000 values of hist you'll get a lot of trash: I suggest you to make a loop from 0 to 10 just for starting: I let as a "homework" to find out wich is the max value that has to take the counter "a" in order to not print unnecesary stuff).
-That the from and dest squares are actually numbers, so if you print a move in which the knight moves from b8 to c6 you should get something like:
Move history list:1-18
So your "printf" shoukld have two %d in order to print out the move correctly.

I suggest you to read about structures in C, write a couple of easy examples, see how to access the data stores in a struct, maybe create a structure that has as a member another structure, and then return to secondchess code.

Best

 Emilio

PS: I could write here the way to print out the info you want, but I don't think I'd be making you any favor.

Last edited by pocopito on Tue Dec 24, 2013 7:21 pm; edited 1 time in total (Reason for editing : Make text more clear and add PS)

descriptionSecondChess - Page 3 EmptyPrinting move history list in SecondChess

more_horiz
Emilio
Thanks for your reply. Over the last 2 months I have been studying and learning C a lot and done several online courses but as yet have not printed arrays from structures nor worked with structures much.
All your comments make sense to me, but so far my code efforts either will not compile (producing errors and warnings) or give garbage outputs.

I will struggle on myself but it is very hard doing this on my own and gets very frustrating as I spend lots of time without much progress.
Anyway, I do appreciate your help, so again many thanks and best wishes (btw Happy Christmas to you!).

descriptionSecondChess - Page 3 EmptyRe: SecondChess

more_horiz
Permissions in this forum:
You cannot reply to topics in this forum