Browse Source

saving font

master
Lev 3 years ago
parent
commit
29d9de615a
  1. 1
      turtle_2/font.json
  2. 14
      turtle_2/task_2.py

1
turtle_2/font.json

@ -0,0 +1 @@
{"0": [[0, 0], [1, 0], [1, 1], [1, 2], [0, 2], [0, 1], [0, 0]], "1": [[0, 1], [1, 0], [1, 1], [1, 2]], "2": [[0, 0], [1, 0], [1, 1], [0, 2], [1, 2]], "3": [[0, 0], [1, 0], [0, 1], [1, 1], [0, 2]], "4": [[0, 0], [0, 1], [1, 1], [1, 0], [1, 2]], "5": [[1, 0], [0, 0], [0, 1], [1, 1], [1, 2], [0, 2]], "6": [[1, 0], [0, 1], [1, 1], [1, 2], [0, 2], [0, 1]], "7": [[0, 0], [1, 0], [0, 1], [0, 2]], "8": [[0, 0], [1, 0], [1, 1], [0, 1], [0, 2], [1, 2], [1, 1], [0, 1], [0, 0]], "9": [[0, 0], [1, 0], [1, 1], [0, 2], [1, 1], [0, 1], [0, 0]]}

14
turtle_2/task_2.py

@ -1,20 +1,10 @@
import turtle as t
import typing
import math
import json
DATA: typing.Dict[str, typing.List[typing.Tuple[int, int]]] = {
'0': [(0, 0), (1, 0), (1, 1), (1, 2), (0, 2), (0, 1), (0, 0)],
'1': [(0, 1), (1, 0), (1, 1), (1, 2)],
'2': [(0, 0), (1, 0), (1, 1), (0, 2), (1, 2)],
'3': [(0, 0), (1, 0), (0, 1), (1, 1), (0, 2)],
'4': [(0, 0), (0, 1), (1, 1), (1, 0), (1, 2)],
'5': [(1, 0), (0, 0), (0, 1), (1, 1), (1, 2), (0, 2)],
'6': [(1, 0), (0, 1), (1, 1), (1, 2), (0, 2), (0, 1)],
'7': [(0, 0), (1, 0), (0, 1), (0, 2)],
'8': [(0, 0), (1, 0), (1, 1), (0, 1), (0, 2), (1, 2), (1, 1), (0, 1), (0, 0)],
'9': [(0, 0), (1, 0), (1, 1), (0, 2), (1, 1), (0, 1), (0, 0)]
}
DATA: typing.Dict[str, typing.List[typing.Tuple[int, int]]] = json.loads(open('font.json').read())
DIGIT_SIZE = 25

Loading…
Cancel
Save