deep-pink icon indicating copy to clipboard operation
deep-pink copied to clipboard

AssertionError - assert(gn_current.board().turn == 0)

Open rayexar opened this issue 10 years ago • 7 comments

I'm getting AssertionErrors when trying to run play.py, with the output looking like this:

maxd 1.000000 maxn 278.426311
Traceback (most recent call last):
  File "C:\Users\Lol\Desktop\deep-pink-master\deep-pink-master\play.py", line 226, in game
    gn_current = player.move(gn_current)
  File "C:\Users\Lol\Desktop\deep-pink-master\deep-pink-master\play.py", line 119, in move
    assert(gn_current.board().turn == 0)
AssertionError

and keeps repeating itself. Any idea on how to fix this?

rayexar avatar Dec 24 '15 02:12 rayexar

The model can only play one of the sides (i don't remember which but I think black)

Are you running it off the shelf or did you make any modifications? I haven't touched this code in a year+ so I don't remember exactly how it works

erikbern avatar Dec 24 '15 17:12 erikbern

I'm running it off the shelf. It looks like with sunfish the player plays as white by default (although the pieces are displayed as black for some reason).

rayexar avatar Dec 27 '15 07:12 rayexar

How did you solve the infinite assersion errors? @rayexar

vyasgiridhar avatar Mar 27 '16 07:03 vyasgiridhar

@vyasgiridhar I didn't manage to fix that...

rayexar avatar Mar 27 '16 07:03 rayexar

@rayexar I found the mistake The problem is at gn_current.board().turn. It returns a boolean, not a integer.

vyasgiridhar avatar Mar 28 '16 13:03 vyasgiridhar

great if you want to submit a pull request and fix it

erikbern avatar Mar 28 '16 13:03 erikbern

just do assert(not gn_current.board()) should be enough

erikbern avatar Mar 28 '16 13:03 erikbern