tot_moves = 0
all_moves = []
num_runs = 10000
for i in range(num_runs):
    game.run()
    moves = SL.count_moves(game.records)
    tot_moves += moves
    all_moves.append(moves)
print(tot_moves/num_runs)

max(all_moves)

df = pd.DataFrame({'moves': all_moves})

df.describe()

type(df['moves'].value_counts())

move_counts = df['moves'].value_counts()

"""
Explanation: Find average number of moves in 1000 games (variable num_runs)
End of explanation
"""


df.hist(bins=max(move_counts.keys())-min(move_counts.keys()))

"""
Explanation: We want as many bins as there are integers between the lowest and highest number of moves found in the data!
keys is the method of the pd.Series object that pulls out those numbers. This approach is more robust than simply taking len(move_counts) in case some # moves are not represented.
End of explanation
"""


