From e257b7b3a17ed3286ac91b40ba194d2a0c83b4e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Fri, 12 Feb 2021 14:36:15 +0100 Subject: [PATCH] Coroutines --- README.md | 3 ++- index.html | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fdc46c5..516b0e3 100644 --- a/README.md +++ b/README.md @@ -2292,7 +2292,8 @@ async def main_coroutine(screen): async def random_controller(id_, moves): while True: - moves.put_nowait((id_, random.choice(list(D)))) + move = id_, random.choice(list(D)) + moves.put_nowait(move) await asyncio.sleep(random.random() / 2) async def human_controller(screen, moves): diff --git a/index.html b/index.html index c72c529..ccdec7e 100644 --- a/index.html +++ b/index.html @@ -2015,7 +2015,8 @@ D = enum.Enum('D', 'n async def random_controller(id_, moves): while True: - moves.put_nowait((id_, random.choice(list(D)))) + move = id_, random.choice(list(D)) + moves.put_nowait(move) await asyncio.sleep(random.random() / 2) async def human_controller(screen, moves):