Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: unsupported operand type(s) for << #4

Open
julienroyd opened this issue Apr 3, 2018 · 1 comment
Open

TypeError: unsupported operand type(s) for << #4

julienroyd opened this issue Apr 3, 2018 · 1 comment

Comments

@julienroyd
Copy link

When I run game.py with either arthur or random_agent, I get the following error :

Traceback (most recent call last):
  File "game.py", line 237, in <module>
    status = main()
  File "game.py", line 168, in main
    B.make_move(cpu_1.make_move(B))
  File "C:\Users\julro\Desktop\Coding\DeepCheckers\checkers-master\checkers.py", line 66, in make_move
    taken_piece = int(1 << sum(i for (i, b) in enumerate(bin(move)[::-1]) if b == '1')/2)
TypeError: unsupported operand type(s) for <<: 'int' and 'float'

It doesn't always occur on the same line but it's always that same TypeError

@SentinelWarren
Copy link

You're probably using Python 3, in Python 3 the / operator is a floating point division, change it to // instead for integer division.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants