Poker game in python:
NEWB here. How do I have the big/small blinds rotate every turn.I call this function in my main. Any help is appreciated.
Code:
poker table function:
def post_blinds(self,smallblind,bigblind):
self.smallblind = smallblind
self.bigblind = bigblind
x=0
for player in self.players:
if player == self.players[x+1]:
player.stack = player.stack - smallblind
if player == self.players[x+2]:
player.stack = player.stack - bigblind
x += 1
print(x)
def main():
players = (Player("Player 1",200), Player("Player 2",200),Player("Player 3",200),Player("Player 4",200),Player("Player 5",200),Player("Player 6",200))
table = Table(players)
table.post_blinds(1,2) #Post Blinds
table.deal_cards() #Deal 2 cards to each player