Hello!
Very interesting project. I have just downloaded it and read the overview.
As a first step in Lua chess programming, I made a simple FEN Validator. With your permission, I post it here.
Chess.lua
- Roland Chastain
- Prole
- Posts: 41
- Joined: Sat Feb 07, 2015 2:30 pm
- Location: France
- Contact:
Re: Chess.lua
- Attachments
-
- fen-validator.lua
- (1.74 KiB) Downloaded 216 times
Re: Chess.lua
Hello Roland,
Not a bad start, but I should point out that you can't really validate a position just based on FEN input -
Ya, it's good to check if the material is right and that the two kings are on the board but you still need moves validation
to make sure that the game doesn't start in check. For example, if I'm white and I'm on the move, I shouldn't be
able to 'capture' the opponent's king.
It's a good start though and chess programming is awesome.
Not a bad start, but I should point out that you can't really validate a position just based on FEN input -
Ya, it's good to check if the material is right and that the two kings are on the board but you still need moves validation
to make sure that the game doesn't start in check. For example, if I'm white and I'm on the move, I shouldn't be
able to 'capture' the opponent's king.
It's a good start though and chess programming is awesome.
Last edited by ivan on Sat Jun 20, 2015 4:44 am, edited 1 time in total.
- Roland Chastain
- Prole
- Posts: 41
- Joined: Sat Feb 07, 2015 2:30 pm
- Location: France
- Contact:
Re: Chess.lua
Yes, it's true. The purpose of that little function is just to check that the form of the string is correct. Thank you for your observation.
-
- Prole
- Posts: 1
- Joined: Thu Apr 23, 2020 6:09 pm
Re: Chess.lua
Cool library. I'm trying to use it as a move validator for an interface that I am building.
What is the state of of code? I uncommented out the auto-play demo in example1.lua and was able to get it running after making some minor changes (mostly making dots into colons on the function calls). It seems like the example code tries to call some functions that don't exist (pos.isCheck() and pos.isThreefold()). There's also some serialization code to support (I assume) detection of the 3-fold repetition case in the pos.lua file that is commented out.
Looked at the commit history, it looks like maybe the functionality I am looking for was working in with commit ec18735 on
2019-10-20.
I'm trying to figure out if I should:
1. Try to merge that code over to the latest branch
2. If that code doesn't work well anyways, write my own versions of the functions I need
What is the state of of code? I uncommented out the auto-play demo in example1.lua and was able to get it running after making some minor changes (mostly making dots into colons on the function calls). It seems like the example code tries to call some functions that don't exist (pos.isCheck() and pos.isThreefold()). There's also some serialization code to support (I assume) detection of the 3-fold repetition case in the pos.lua file that is commented out.
Looked at the commit history, it looks like maybe the functionality I am looking for was working in with commit ec18735 on
2019-10-20.
I'm trying to figure out if I should:
1. Try to merge that code over to the latest branch
2. If that code doesn't work well anyways, write my own versions of the functions I need
Re: Chess.lua
Thank you for using the library. I had done some additional improvements so the examples were out of date.
I have just pushed an update so the examples should be working fine now.
1.The "best" version of the code is available here:
https://github.com/2dengine/chess.lua
2.As far as I know everything should work fine.
If you want to test it, I recommend running the validator on large PGN files as shown in the first example.
The second example shows how to make an interface.
It looks like some historical games don't follow the threefold repetition rule so you only need this for live games.
I have just pushed an update so the examples should be working fine now.
1.The "best" version of the code is available here:
https://github.com/2dengine/chess.lua
2.As far as I know everything should work fine.
If you want to test it, I recommend running the validator on large PGN files as shown in the first example.
The second example shows how to make an interface.
I had temporarily disabled this for testing purposes.There's also some serialization code to support (I assume) detection of the 3-fold repetition case in the pos.lua file that is commented out.
It looks like some historical games don't follow the threefold repetition rule so you only need this for live games.
Who is online
Users browsing this forum: No registered users and 3 guests