From 8e4e8f8987b2b26dd1bb997cd73c670f4128210e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Sun, 15 Mar 2020 18:04:06 +0100 Subject: [PATCH] Pygame --- README.md | 2 +- index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fa01d5e..67e6917 100644 --- a/README.md +++ b/README.md @@ -2922,7 +2922,7 @@ screen = pg.display.set_mode((500, 500)) rect = pg.Rect(240, 240, 20, 20) while all(event.type != pg.QUIT for event in pg.event.get()): deltas = {pg.K_UP: (0, -3), pg.K_RIGHT: (3, 0), pg.K_DOWN: (0, 3), pg.K_LEFT: (-3, 0)} - for delta in {deltas.get(i) for i, on in enumerate(pg.key.get_pressed()) if on}: + for delta in (deltas.get(i) for i, on in enumerate(pg.key.get_pressed()) if on): rect = rect.move(delta) if delta else rect screen.fill((0, 0, 0)) pg.draw.rect(screen, (255, 255, 255), rect) diff --git a/index.html b/index.html index b0c4aad..5ff6b75 100644 --- a/index.html +++ b/index.html @@ -2485,7 +2485,7 @@ screen = pg.display.set_mode((500, 240, 240, 20, 20) while all(event.type != pg.QUIT for event in pg.event.get()): deltas = {pg.K_UP: (0, -3), pg.K_RIGHT: (3, 0), pg.K_DOWN: (0, 3), pg.K_LEFT: (-3, 0)} - for delta in {deltas.get(i) for i, on in enumerate(pg.key.get_pressed()) if on}: + for delta in (deltas.get(i) for i, on in enumerate(pg.key.get_pressed()) if on): rect = rect.move(delta) if delta else rect screen.fill((0, 0, 0)) pg.draw.rect(screen, (255, 255, 255), rect)