Files
cis163/chess/player.py
cutsweettea cb8e6e9b5a more cool stuff
chess, woah
2025-10-15 12:46:55 -04:00

15 lines
290 B
Python

from enum import Enum
class Player(Enum):
BLACK = 0
WHITE = 1
def next(self):
cls = self.__class__
members = list(cls)
index = members.index(self) + 1
if index >= len(members):
index = 0
return members[index]