Advertisement
Guest User

Untitled

a guest
Apr 1st, 2020
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. if random.randint(1,2) == 2 and colors[balls.index(ball)] == "blue" and colors[balls.index(ball1)] == "green":
  2. #ball1 is getting infected
  3. timeInfected[balls.index(ball1)] = time
  4. infected += 1
  5. ball1.color("blue")
  6. colors[balls.index(ball1)] = "blue"
  7. pen.clear()
  8. pen.write("Infected: " + str(infected) + " " + "Susceptible: " + str(100-infected), align="center", font=("Courier", 14, "normal"))
  9. if random.randint(1,2) == 2 and colors[balls.index(ball)] == "green" and colors[balls.index(ball1)] == "blue":
  10. #ball is getting infected
  11. timeInfected[balls.index(ball)] = time
  12. infected += 1
  13. ball.color("blue")
  14. colors[balls.index(ball)] = "blue"
  15. pen.clear()
  16. 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