Chess Programming, The initial process

in #programming7 years ago

The plan

I want to make a program for my chess training.

I have a particular thing I want the program to do, being able to go over a game and pick out some random positions for me to try to work out, I might want to know the last move, so I know whether the last move was a simple exchange.

First thing for a chess program

So the absolute first thing you have to do when making a chess program is to program all the rules into the computer, but also implementing a board so the computer have an idea about where the piece are, the next thing would be figuring out how to make the computer understand the Portable Game Notation, which is the simple format with which all officially rated games are recorded.

My Progress so far

So I have a good idea about how I should implement the board, I have not fully implemented it just, but that is just a question of copying some code and pasting it with small changes.

That implements a part of what we call the bitboard which is one of the most efficient implementations of a chessboard this is often used by the chess engines, I am not making a chess engine as such, but I thought this might be a smart implementation anyway.

Anyway with a reasonable board implementation I began to tackle the next problem on my list, possibly I am trying this a little early, I might find some problems if I want to go on with the short form of pgn (and I would like this eventually, but perhaps making something that can make moves now would be a nice boost).

Anyway I decided that translating the pgn would be best done with a coordinate system, so I began doing this, and I do have a reasonable implementation of this, it isn't perfect but I suspect it will be fine for now, I might need some redesign later.

the part called trans in that piece of code would be nicer if it was outside the function and callable from other functions, but I did not get that to work yet, it might just need a slight tweak, and I will look at that later.

But this is all I have for now, I will write an update on this when I get further down the road.


Remember to vote and resteem, thanks

Sort:  

Very interesting, I'll have to pick up a little ruby to do my chess greetings :D

I am refactoring a little right now, perhaps I will get to write another post on this soon

I follow you, waiting to see you ...

I am trying to work on it right now (but then my editor gave me some problems so then I end up working on the config for that :S)

Hahaha that bad, when we think of sitting down to solve a problem we must solve other problems many times to me too happens to me :S

I could write a really long post on editors, right now I am using vim, but that is really only be cause emacs on windows is a nightmare, if I had a useful OS I probably would use emacs.

Why do you use Windows: O
Switch to Linux hahahaha

I have only 1 computer with windows on it, and I only have that for gaming, I am just a little to lazy to switch, that is to get my other computer with linux installed.

Coin Marketplace

STEEM 0.17
TRX 0.16
JST 0.031
BTC 60836.17
ETH 2567.48
USDT 1.00
SBD 2.57