Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- import os
- import time
- width = 20
- height = 20
- array = []
- for i in range(height):
- row = []
- for i in range(width):
- row.append(round(random.random()-0.3))
- array.append(row)
- def prettify(cell):
- if cell == 0:
- return '░'
- return '▓'
- def print_game():
- os.system("clear")
- for y in range(height):
- print(' '.join([prettify(cell) for cell in array[y]]))
- while True:
- print_game()
- #################
- # put code here #
- #################
- time.sleep(0.1)
- # input('')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement