Open Side Menu Go to the Top
Register
How to print possible outcomes of a board in the flop? How to print possible outcomes of a board in the flop?

01-09-2017 , 08:55 AM
I have an array of cards which marks cards that are currently used.
How can i use it to show all possible runouts from this point?
I'am running a for loop for the turn card that will pick a card no used at the moment, mark it used and call function again to run a for loop to pick card for this river. Then it prints current board run out.
This strategy is printing too much. n choose k(45, 2) is 990, however it's printing 1980 times for me.
How to print possible outcomes of a board in the flop? Quote
01-09-2017 , 09:44 AM
here is a simple way to do it with two cards in python, three would look similar

Code:
board = ['', '', '']
remaining_cards = [x for x in range(10)]
for x in remaining_cards:
	board[0] = x
	for y in remaining_cards:
		if y != x:
			board[1] = y
			print board
How to print possible outcomes of a board in the flop? Quote
01-09-2017 , 10:19 AM
Quote:
Originally Posted by plx
This strategy is printing too much. n choose k(45, 2) is 990, however it's printing 1980 times for me.
You're calculating the number wrong. choose(45, 2) will pick 2 cards out of 45 where the order doesn't matter. But the order of the turn and river DO matter.

Using choose() for the flop is fine because the order of flop cards is not important.
How to print possible outcomes of a board in the flop? Quote

      
m