mirror of
https://code.lenaisten.de/Lenaisten/advent22.git
synced 2024-11-23 00:03:07 +00:00
pre-create xy_range
This commit is contained in:
parent
e4f9ded5c8
commit
39d375ced0
1 changed files with 1 additions and 2 deletions
|
@ -162,11 +162,10 @@ async def gen_day_auto_image(
|
||||||
image = await AdventImage.from_img(img, cfg)
|
image = await AdventImage.from_img(img, cfg)
|
||||||
|
|
||||||
rnd = await Random.get(day)
|
rnd = await Random.get(day)
|
||||||
|
xy_range = range(cfg.image.border, (cfg.image.size - cfg.image.border))
|
||||||
|
|
||||||
# Buchstaben verstecken
|
# Buchstaben verstecken
|
||||||
for letter in day_parts[day]:
|
for letter in day_parts[day]:
|
||||||
xy_range = range(cfg.image.border, (cfg.image.size - cfg.image.border))
|
|
||||||
|
|
||||||
await image.hide_text(
|
await image.hide_text(
|
||||||
xy=cast(_XY, tuple(rnd.choices(xy_range, k=2))),
|
xy=cast(_XY, tuple(rnd.choices(xy_range, k=2))),
|
||||||
text=letter,
|
text=letter,
|
||||||
|
|
Loading…
Reference in a new issue