Chess Programming, some progress

in #writing7 years ago

Updates

I figured out a slightly better way to make the boards, saving some lines of code.


At least this part of the code seems to be good, I also worked on some other problems

PGN Translation

One of the problems I did some work on is trying to figure out how to translate the PGN, I did make some progress since yesterday

The way the board is oriented is a little weird with the way PGN is read, but I did find a simple solution to this problem, hooray for maths

I figured out that by subtracting 7 and taking the absolute of that I would essentially just flip the board on one axis, but I then I couldn't find ruby's abs, so off to google, but in the meantime I had worked out what I would do, better than to possibly load a module for such a simple function

-(num)

num is a variable

This was my solution, I decided it might not be so great since this will not handle positive numbers gracefully, so I wrote the abs function to handle all cases (I don't care for floats at this point, and I do not think this would be relevant in this project).

Refactoring

This code I decided trans should be posted in a function by itself so I can use it for other things, that might not be necessary but it takes no extra effort to do this.

Next thing to work on

The next thing to work on would be the making a move, after that it should learn all the rules in chess.

The last thing would be figuring out how to do short form PGN.

Plans for the future

I have some ideas where I want this to go, one idea is that it should be able to produce diagrams from games, with random position's so it can be used as training material

I had another idea that might make this somewhat more interesting, this would be very nice for steemit, not necessarily for playing and possibly not even touching the steem block-chain, but possibly a writing app for chess writers producing markdown, it also could do stuff with the steem blockchain

Sort:  

Wow, dude nice code what is the programming language you used.

That's some serious line of code. Should try Python language. Are you a programmer??
upvoted and followed.

I am not working as a programmer, this way I can focus on the stuff I like doing with code, honestly I do not like python so much, I would like to be able to grog haskell.

Good luck with Ruby then.

Coin Marketplace

STEEM 0.19
TRX 0.14
JST 0.029
BTC 64112.50
ETH 3174.45
USDT 1.00
SBD 2.54