trewe / Valley_of_the_Ancients

GNU General Public License v2.0
1 stars 1 forks source link

2p Othello: undetected game end #2

Open soliton- opened 4 years ago

soliton- commented 4 years ago

A24703CF-9B4F-4488-8999-B42A78E61008

The game didn’t end when no legal move was left.

Btw, impressive you implemented an AI for this and it seems not entirely bad even! 😃

trewe commented 4 years ago

even after ending turn? the ai should check a valid move when just ending the turn and pass a "cannot play" flag if there is none. It could made maybe a bit cleaner, but don't think there is a sensible way to check in-turn ...

soliton- commented 4 years ago

It seems I have no autosave or anything so I'll try to reproduce this.

From the image you can see it's turn 35 though and a game should only last 30 turn or so?

soliton- commented 4 years ago

So when I reproduced a similar ending with one spot left open I simply ended my turn and that indeed triggered the victory. That probably just didn't occur to me last time since the other turns end automatically.

I did play with the updated version though so the commit didn't help. Probably because side played is still yes which makes sense. Perhaps easiest would be to check at the start of the players turn if he has no moves.

trewe commented 4 years ago

mmh, ok. To check at start at turn, I would actually have to refactor the code which will need to wait until later.

A match in othello lasts 32 turns plus the amount of forfeit ones.