
import turtle
import random
import matplotlib.pyplot as plt

# ----- Constants declared here -----

# Each turtle moves 10 distance units each turn.
MOVE_DISTANCE = 10
# The number of turtles in the simulation.
NUM_TURTLES = 250
# The number of turns in the simulation.
NUM_TIMESTEPS = 100

# ----- Functions declared here -----
# TODO: write 3 functions: create_turtles(), move_turtles(), get_distances().

# ----- Begin main code -----

window = turtle.Screen()
# Only update the screen every 100 moves
window.tracer(100)
# TODO: call function create_turtles and store 
# result in all_turtles

# TODO: loop NUM_TIMESTEPS times. In the loop, call move_turtles() passing 
# in the all_turtles and MOVE_DISTANCE.

# Show all moves immediately
window.tracer(True)

# make a histogram to show how far the turtles traveled from the origin
# TODO: call function to get distances and pass results to plt.hist()

# Show the histogram.
plt.show()

# Keep the turtle window open until it gets clicked on.
window.exitonclick()

