Title
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)