From 6bea41fdbc4b2f75d0806362a295118fd8309794 Mon Sep 17 00:00:00 2001 From: Illia Soloviov <74905269+wav3solo@users.noreply.github.com> Date: Thu, 1 Feb 2024 16:18:40 +0100 Subject: [PATCH] added RumbleTest.java --- src/RumbleTest.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/RumbleTest.java diff --git a/src/RumbleTest.java b/src/RumbleTest.java new file mode 100644 index 0000000..5fb5fa8 --- /dev/null +++ b/src/RumbleTest.java @@ -0,0 +1,22 @@ +public class RumbleTest { + public static void main(String[] args) { + int numberOfBots = 5; + + Thread[] botThreads = new Thread[numberOfBots]; + + for (int i = 0; i < numberOfBots; i++) { + RumbleBot rumbleBot = new RumbleBot(args); + + botThreads[i] = new Thread(rumbleBot::run); + botThreads[i].start(); + } + + for (Thread botThread : botThreads) { + try { + botThread.join(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + } +} \ No newline at end of file