Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. import random
  2. import os
  3. import time
  4.  
  5. width = 20
  6. height = 20
  7.  
  8. array = []
  9.  
  10. for i in range(height):
  11. row = []
  12. for i in range(width):
  13. row.append(round(random.random()-0.3))
  14. array.append(row)
  15.  
  16. def prettify(cell):
  17. if cell == 0:
  18. return '░'
  19. return '▓'
  20.  
  21. def print_game():
  22. os.system("clear")
  23. for y in range(height):
  24. print(' '.join([prettify(cell) for cell in array[y]]))
  25.  
  26. while True:
  27. print_game()
  28. #################
  29. # put code here #
  30. #################
  31. time.sleep(0.1)
  32. # input('')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement