basant/basant/shared/helpers.py

14 lines
396 B
Python

import random
def generateBlocks(size=1):
# Generates a length size unicode string that is formed from blocks
charList = ['', '', '', '', '', '', '▖▗',
'▘▙', '', '', '', '', '', '']
ret = ""
while size > 0:
size = size - 1
rand = random.randint(0, 13)
ret = ret + charList[rand]
return ret