def do_imbal(bot): bot.state=0 bot.say_main("All imbalenced players have submitted moves.") for player in bot.imbal[0]: for move in bot.players[player][2]: bot.players[bot.player_list[move[1]]][1]+=move[0] bot.players[player][1]=bot.players[player][3] bot.players[player].pop(4) bot.players[player].pop(3) bot.imbal=[[],[]] say_hands(bot) imb=[[],[]]#(more),(less) for player in bot.player_list: bot.players[player][2]=() if len(bot.players[player][1])>4: imb[0].append(player) elif len(bot.players[player][1])<4: imb[1].append(player) if find_win(bot): hardstop(bot) elif imb[0]: imbalence(bot,imb) else: bot.state=2
def do_moves(bot): bot.say_main("All players have submitted moves.") bot.state=0 for player in bot.player_list: give=bot.players[player][2][0] hand = list(bot.players[player][1]) hand.pop(hand.index(give)) bot.players[player][1]="" for x in hand: bot.players[player][1] += x bot.players[bot.player_list[bot.players[player][2][1]]][1]+=bot.players[player][2][0] say_hands(bot) if find_win(bot): hardstop(bot) else: imb=[[],[]]#(more),(less) for player in bot.player_list: bot.players[player][2]=() if len(bot.players[player][1])>4: imb[0].append(player) elif len(bot.players[player][1])<4: imb[1].append(player) if imb[0]: imbalence(bot,imb) else: bot.state=2