File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -2292,7 +2292,8 @@ async def main_coroutine(screen):
22922292
22932293async def random_controller (id_ , moves ):
22942294 while True :
2295- moves.put_nowait((id_, random.choice(list (D))))
2295+ move = id_, random.choice(list (D))
2296+ moves.put_nowait(move)
22962297 await asyncio.sleep(random.random() / 2 )
22972298
22982299async def human_controller (screen , moves ):
Original file line number Diff line number Diff line change 20152015
20162016< span class ="hljs-keyword "> async</ span > < span class ="hljs-function "> < span class ="hljs-keyword "> def</ span > < span class ="hljs-title "> random_controller</ span > < span class ="hljs-params "> (id_, moves)</ span > :</ span >
20172017 < span class ="hljs-keyword "> while</ span > < span class ="hljs-keyword "> True</ span > :
2018- moves.put_nowait((id_, random.choice(list(D))))
2018+ move = id_, random.choice(list(D))
2019+ moves.put_nowait(move)
20192020 < span class ="hljs-keyword "> await</ span > asyncio.sleep(random.random() / < span class ="hljs-number "> 2</ span > )
20202021
20212022< span class ="hljs-keyword "> async</ span > < span class ="hljs-function "> < span class ="hljs-keyword "> def</ span > < span class ="hljs-title "> human_controller</ span > < span class ="hljs-params "> (screen, moves)</ span > :</ span >
You can’t perform that action at this time.
0 commit comments