Advertisement
Guest User

Untitled

a guest
May 24th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. # Infect a few random people
  2.  
  3. to_infect = 10
  4.  
  5. for i in range( to_infect ):
  6. cell_available = False
  7. while not( cell_available ):
  8. x = random.randint( int( grid_width / 2 ) , grid_width - 1 )
  9. y = random.randint( int( grid_height / 2 ) , grid_height - 1 )
  10. cell_available = ( grid[ y ][ x ] == 1 )
  11. grid[ y ][ x ] = 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement