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):
2292
2292
2293
2293
async def random_controller (id_ , moves ):
2294
2294
while True :
2295
- moves.put_nowait((id_, random.choice(list (D))))
2295
+ move = id_, random.choice(list (D))
2296
+ moves.put_nowait(move)
2296
2297
await asyncio.sleep(random.random() / 2 )
2297
2298
2298
2299
async def human_controller (screen , moves ):
Original file line number Diff line number Diff line change 2015
2015
2016
2016
< 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 >
2017
2017
< 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)
2019
2020
< span class ="hljs-keyword "> await</ span > asyncio.sleep(random.random() / < span class ="hljs-number "> 2</ span > )
2020
2021
2021
2022
< 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