Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from main import Die
- import pygal
- from sys import path
- print(path)
- die = Die()
- results = []
- for roll_num in range(1000):
- result = die.roll()
- results.append(result)
- frequencies = []
- for value in range (1, die.num_sides+1):
- frequency = results.count(value)
- frequencies.append(frequency)
- hist = pygal.Bar()
- hist.force_uri_protocol = 'http'
- hist.title = "Wyniki rzucania pojedynczą kością D6 tysiąc razy"
- hist.x_labels = ['1', '2', '3', '4', '5', '6']
- hist.x_title = "Wynik"
- hist.y_title = "Częstotliwość występowania wartości"
- hist.add('D6', frequencies)
- hist.render_to_file('die_visual.svg')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement