#!/usr/bin/env python # Compose each piece SVG with numbers # https://travishorn.com/removing-parts-of-shapes-in-svg-b539a89e5649 # https://developer.mozilla.org/fr/docs/Web/SVG/Tutoriel/Paths preamble = """ """ black_left = '' white_right = '' white_left = '' black_right = '' digits = { "left": [ # 1 '', # 2 '', # 3 '', # 4 '', # 5 '', # 6 '', # 7 '', # 8 '', # 9 '', # 10 '', # 11 '', # 12 '' ], "right": [ # 1 '', # 2 '', # 3 '', # 4 '', # 5 '', # 6 '', # 7 '', # 8 '', # 9 '', # 10 '', # 11 '', # 12 '' ] } final = "" for colorLeft in ["white", "black"]: chrShift = 0 if colorLeft == "white" else 32 for left in range(12): for right in range(12): filename = chr(65 + left + chrShift) + chr(65 + right + chrShift) + ".svg" f = open(filename, "w") f.write(preamble) f.write("\n"); f.write(black_right if colorLeft == "white" else white_right) f.write("\n"); f.write(white_left if colorLeft == "white" else black_left) f.write("\n"); f.write(digits["left"][left]) f.write("\n"); f.write(digits["right"][right]) f.write("\n"); f.write(final) f.close()