Search code examples
c#javac++chess

implementing code for customized mini(less squares, less pieces ) chess board 5x5


implementing code for customized mini(less squares, less pieces ) chess board in java or c++ or even in c#

I just want help for making best moves. and I don't need any graphical interface.

enter image description here

input will be given as

"rnkrrppp*****PPPRNKNR"

where

Pawns: P

Rooks: R

Knights: N

King: K

here small letters represents black pieces and capital letters represents white pieces and "*" represents empty square

and output like

a2a3

if best move happened from

a2 to a3

by application only. for every move.

in this no inter face is required because we give input direct as string.

first I started to understand 8*8 chess board programming in java, c++ ,c# but I facing problem to understanding in some cases.

many source codes which seen is attempting moves with predefined best moves list.

and don't have a particular idea to solve this. I want suggestion start this and make this solved.

thanks. and sorry for poor english


Solution

  • You need to study how alpha beta pruning works. There is a lot of literature about chess programming, I suggest you to start from here. As a very little example, look at my project here. I pointed to a file that is a test in finding a best move. My engine is not optimized, but simple enought to get how it works. It does not mind if you are using a reduced keyboard, the algorithm is the same as soon you created a proper move generator and a keyboard evaluator ( usually material value is enought ).