Move Generator free

Discussion of chess software programming and technical issues.

Moderator: Ras

mainsworthy

Move Generator free

Post by mainsworthy »

Hello , Ive finished Mainsworthy ( http://uk.geocities.com/avalomhilly/TextChes.zip ) and have started on Mainsworthy Advanced!

I remebered someone wanted a move generator and he was right a Rapid chess design system would need a premade move gen, so Ive put mine online ( http://uk.geocities.com/avalomhilly/movegen.zip )
its freeware

forgot to mention its c++ source code and its 11kb only,
mainsworthy

Re: Move Generator free

Post by mainsworthy »

Ive also included the source code for Mainsworthy here, so you have an example of putting the move generator to work, the code a little messy, but you will get the idea.

http://uk.geocities.com/avalomhilly/Mainsorc.zip
mainsworthy

Re: Move Generator free

Post by mainsworthy »

anybody feels like modding the source , I will compile for you!
Aleks Peshkov
Posts: 895
Joined: Sun Nov 19, 2006 9:16 pm
Location: Russia
Full name: Aleks Peshkov

Re: Move Generator free

Post by Aleks Peshkov »

The code is not messy, but you Fortran-style of coding is unmaintainable.

Code: Select all

movegen(
unsigned char [8],
unsigned char [8],
unsigned char [8],
unsigned char [8],
unsigned char [8],
unsigned char [8],
unsigned char [8],
unsigned char [8],
unsigned char [8],
unsigned char [8],
unsigned char [8],
unsigned char [8],
unsigned char [8],
unsigned char [8],
unsigned char [8],
unsigned char [8],
unsigned char [6][8],
unsigned char [6][8],
unsigned char [6][8],
unsigned char [6][8],
unsigned char [6][8],
unsigned char [6][8],
unsigned char [6][8],
unsigned char [6][8],
unsigned char [2][8],
unsigned char [2][8],
unsigned char [16][8],
unsigned char [16][8],
unsigned char [3],
unsigned char [3],
unsigned int [2],int [40]);
mainsworthy

Re: Move Generator free

Post by mainsworthy »

Hello Aleks

Ive never seen fortran syntax! but I get the point, I learned C++ as I went along, and its not the best code ,but it gets the job done :) I dont like local variables so I use Arrays sorry!

Mark
Aleks Peshkov
Posts: 895
Joined: Sun Nov 19, 2006 9:16 pm
Location: Russia
Full name: Aleks Peshkov

Re: Move Generator free

Post by Aleks Peshkov »

1) 32 pointers as function parameters are too much. :)
It is much better to wrap all arrays into one-two structures and pass pointers to whole structures rather parts of it.

2) Any function in C++ should have explicit return type.
mainsworthy

Re: Move Generator free

Post by mainsworthy »

Ive included a link to the main source code above, and the movegen function does just that, it takes a set of variables and creates a board structure and then calls the generator.

This move generator isnt meant to be a proffessional system its just a helping hand to the guy on the forum somewhere & anyone else inteseted, that works(im not getting paid so if it works it works, whos to say any method is better than another if it works,I know games programers dont stick to convention, they do what works). I know your right about parameters but as I said I Dont like Local variables I use arrays.

I cant keep getting back online to often, Im a little ditracted with my current project, thanks for your comments

Mark