Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- d = {
- 0: (1,(1,1),0,(1,1),1),
- 1: (0,(0,1),0,(0,1),0),
- 2: (2,(0,1),1,(1,0),1),
- 3: (1,(0,1),1,(0,1),1),
- 4: (0,(1,1),1,(0,1),0),
- 5: (1,(1,0),1,(0,1),1),
- }
- DOT = "*"
- LINE = "|"
- SPACE = " "
- CHAR_SPACE_SIZE = 4
- CHAR_SPACE = SPACE * CHAR_SPACE_SIZE
- BASE_WIDTH = 2
- def draw_layer(num, size, layer):
- num_setting = d[num]
- if layer in {0, 2, 4}:
- return f'{SPACE}{(DOT if num_setting[layer] else SPACE)*BASE_WIDTH*size}{SPACE}'
- return f'{LINE if num_setting[layer][0] else SPACE}' \
- f'{SPACE * BASE_WIDTH * size}' \
- f'{LINE if num_setting[layer][1] else SPACE}'
- def draw(nums, size):
- print(f"printing {nums}, with size {size}")
- for layer in range(5):
- n = 1 if layer in {0, 2, 4} else size
- for i in range(n):
- print(CHAR_SPACE.join(draw_layer(num, size, layer) for num in nums))
- if __name__ == '__main__':
- draw([0, 1, 2, 3, 4, 5], 3)
Add Comment
Please, Sign In to add comment