Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if random.randint(1,2) == 2 and colors[balls.index(ball)] == "blue" and colors[balls.index(ball1)] == "green":
- #ball1 is getting infected
- timeInfected[balls.index(ball1)] = time
- infected += 1
- ball1.color("blue")
- colors[balls.index(ball1)] = "blue"
- pen.clear()
- pen.write("Infected: " + str(infected) + " " + "Susceptible: " + str(100-infected), align="center", font=("Courier", 14, "normal"))
- if random.randint(1,2) == 2 and colors[balls.index(ball)] == "green" and colors[balls.index(ball1)] == "blue":
- #ball is getting infected
- timeInfected[balls.index(ball)] = time
- infected += 1
- ball.color("blue")
- colors[balls.index(ball)] = "blue"
- pen.clear()
- pen.write("Infected: " + str(infected) + " " + "Susceptible: " + str(100-infected), align="center", font=("Courier", 14, "normal"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement