From 2d8b895dc6790941e3f24571e24360a4162931af Mon Sep 17 00:00:00 2001 From: ehermakov Date: Sun, 10 Dec 2023 23:01:46 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B7=D0=B0=D0=B3=D1=80=D1=83=D0=B6=D0=B4?= =?UTF-8?q?=D0=B0=D1=8E=20=D1=81=20=D0=BD=D0=B0=D1=87=D0=B0=D0=BB=D0=BE?= =?UTF-8?q?=D0=BC=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D0=B8=20=D1=83?= =?UTF-8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F=20=D1=80?= =?UTF-8?q?=D0=B0=D0=B7=D0=BC=D0=B5=D1=80=D0=BE=D0=BC=20=D0=BA=D0=BE=D1=80?= =?UTF-8?q?=D0=B0=D0=B1=D0=BB=D0=B5=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HNS/Excercises/ShipCraft/main.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/HNS/Excercises/ShipCraft/main.py b/HNS/Excercises/ShipCraft/main.py index 6b98c6d..11e1db2 100644 --- a/HNS/Excercises/ShipCraft/main.py +++ b/HNS/Excercises/ShipCraft/main.py @@ -96,6 +96,12 @@ def colorize(field, buttons): buttons[i].configure(bg=bg) +def keypress_handler(e): + + if e.keysym == 1: + ship_size = 1 + + def left_button_click(field, row, col): if field_mode == 0: if check_possible(field, row, col): @@ -112,7 +118,7 @@ def right_button_click(d): ship_direction = 1 else: ship_direction = 0 - + def button_enter(field, row, col): if field_mode == 0: