2024-09-28 01:31:16 发布
网友
到目前为止,我已经完成了整个Ezee程序,但是我需要一次模拟1000次,而我却被困在了如何去做。这是我的代码:
<script src="//repl.it/embed/HzBl/24.js"></script>
如果你的意思是同时运行游戏功能1000次。然后需要执行线程:
import threading threads = [] for i in range(1000): th = threading.Thread(name=str(i),target = game) threads.append(th) th.start() for each in threads: each.join()
但是,由于游戏函数的设计,特别是它在运行时输出而不是返回要输出的值,线程问题可能会发生。在
编辑
我已经在您的代码中编辑并实现了它:
如果你的意思是同时运行游戏功能1000次。然后需要执行线程:
但是,由于游戏函数的设计,特别是它在运行时输出而不是返回要输出的值,线程问题可能会发生。在
编辑
我已经在您的代码中编辑并实现了它:
^{pr2}$相关问题 更多 >
编程相关推荐