python - Determine if a dice roll contains certain combinations? -
i writing dice game simulator in python. represent roll using list containing integers 1-6. might have roll this:
[1,2,1,4,5,1]
i need determine if roll contains scoring combinations, such 3 of kind, 4 of kind, 2 sets of 3, , straights.
is there simple pythonic way of doing this? i've tried several approaches, have turned out messy.
reorganize dict value: count
, test presence of various patterns.
Comments
Post a Comment