freevryheid / longbow

warband chess variant
MIT License
6 stars 1 forks source link

Added .nimble file; minor changes to README #2

Closed JohnAD closed 4 years ago

JohnAD commented 5 years ago

As promised, I've upgraded the turn_based_game library to display the players move. However, I didn't see a way to notate that in your code, so I created a .nimble file with this PR.

I also tweaked the readme a little, including instructutions on how to have nimble build the app with the correct libraries automatically.

JohnAD commented 5 years ago

Since I have a PR already in progress, I just added a bug fix also.

The following sequence can lead to a easy win using an invasive pawn:

WINNER IS White
history: @["a3a4", "a8h1", "a4a5", "h8a1", "a5b6", "a1b2", "b6c7", "b2c1", "c7d8"]

Investigating further, it appears that the game's scoring procedure is using the self.winner_player_number. However, the Negamax algo does not set that value; so the possible 10000.0 or -10000.0 scores never happen. I've changed the logic to calculate a current winner independently.

Now, when the above sequence is tried, I get:

history: @["a3a4", "a8h1", "a4a5", "h8a1", "a5b6", "a1b2", "b6c7", "b8c7", ...

I'll make an note to myself to update the documentation in negamax to mention that the variable isn't set. That is something I should have put in the docs in the first place.

freevryheid commented 4 years ago

Thanks John