Quote Originally Posted by celtic123 View Post
should there be something like

if dice_1(i)=dice2(i) and dice_1(i-1)= dice_2(i-1) and dice_1(i-2)=dice2(i-2)then trip=trip+1

to compare the current dice and the 2 previous throws?
No. First, that wouldn't take into account the times when dice_1[i-3] == dice_2[i-3] (you don't want to count those times). Second, an easy way is to just move the "if count == 3" line into the else statement, so you're only checking for a triple once the string of double-throws ended. Not sure what language this is, but I think this will work:

Code:
turns = 10000000
current_turn = 0

dice_1 = [random.randrange(1,7) for i in range(turns)]
dice_2 = [random.randrange(1,7) for i in range(turns)]

doubles = [ dice_1[i] == dice_2[i] for i in range(turns)]
triples = []

count = 0
for i in range(len(doubles)):
    if doubles[i]==True:
        count += 1
    else:
        if count == 3:
            triples.append(i)
        count = 0