import random
x = 0
y = 0
z = 0
nights = 0
turn = 0
stopped = 0
turns = []

while (nights < 10):
    #rando movement
    step = random.randrange(6)
    if step == 0:
        x = x+1
    if step == 1:
        x = x-1
    if step == 2:
        y = y+1
    if step == 3:
        y = y-1
    if step == 4:
        z = z+1
    if step == 5:
        z = z-1
    #Turn counter
    turn = turn + 1
    #Goal check
    if x == 0 and y == 0 and z == 0:
        nights = nights + 1
        print("The Bird Has Made It Home After ", turn, "Turns")
        turns.append(turn)
        turn = 0
    if turn/1000 % 1000 == 0 and x + y + z != 0:
        print("(", x,y, ") ","| ", z)
    #Too long Stoper
    if (turn > 1000000):
        stopped = stopped + 1
        turn = 0
        x = 0
        y = 0
        z = 0
        nights = nights + 1
        print("Caped")
    
average = sum(turns) / len(turns)
print("Avaerage", average,"Ones that when't too long ", stopped)
( 247 -142 )  |  279
Caped
( 753 -339 )  |  360
Caped
The Man Has Made It Home After  2 Turns
( 78 -371 )  |  553
Caped
( -114 704 )  |  -362
Caped
The Man Has Made It Home After  2 Turns
( 318 1396 )  |  -472
Caped
( 909 -391 )  |  478
Caped
( -385 -68 )  |  143
Caped
( 369 357 )  |  1534
Caped
Avaerage 2.0 Ones that wen't too long  8