Created
February 22, 2017 15:39
-
-
Save uktechreviews/673910559665f22b9a3d71e816853fdc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import randint | |
particles = [] ## create an empty list | |
results = [] ## create a blank list for the results | |
max_count = 100 ## start with this number of cubes | |
x_series = [] | |
while (max_count > 1) : | |
for i in range (max_count): ## populate array with random dice throws | |
face = randint(1,6) | |
particles.append(face) | |
for items in particles: ## read the array back and remove 'face up' | |
if items == 6: | |
max_count -=1 | |
particles = [] ## reset particles array | |
results.append(max_count) | |
for items in results: ## Read the results back | |
print (items) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment