diff --git a/launcher.py b/launcher.py index 806528a..3dde4cb 100644 --- a/launcher.py +++ b/launcher.py @@ -1,8 +1,23 @@ import main -number_of_launches = 4 -result_list = [] -for i in range(number_of_launches): - result_list.append(main.main()) -for result in result_list: - print("Game " + result[0] + " had a score of: " + str(result[1])) -input("Press Enter to exit") \ No newline at end of file +import time +from multiprocessing import Pool +import multiprocessing + +proc_running = 4 # MAX 4!!! + + +def run_main(n): + result = main.main() + return result + + +def launch(list): + for result in list: + print("Game " + result[0] + " had a score of: " + str(result[1])) + input("Press Enter to exit") + + +if __name__ == '__main__': + with Pool(proc_running) as p: + results = p.map(run_main, range(proc_running)) + launch(results)