The consensus seems to be that this is not possible. Based on the scenarios, I'm used to doing a lot of manual tests, and I like to compile the program with almost every change.
The next class (bomber) does System.exit (0) after 10 minutes. Just drop the Bomb object in Main, Bomber daBomb = new Bomber(); and run from daBomb.reset(); to reset the timer. As soon as the processes gather like flies on the windowsill, you press double X (
) on the console tab bar to close the console of all dead processes.
public class Bomber { Bomb bomb = new Bomb(); public Bomber() throws InterruptedException { Thread thread = new Thread(bomb); thread.start(); } public void reset() { bomb.reset(); }
How thoughtfully you want to use the Bomber functionality is up to you. I created a function for Main. Please note that the following may not work perfectly, as I just pulled out a bunch of non-core code and did not test to make sure it still works.
public static void startUp() throws InterruptedException { Bomber daBomb = new Bomber(); String input = ""; Interpreter console = new Interpreter(); while (!input.equalsIgnoreCase("quit")) { daBomb.reset(); input = terminal.next().toLowerCase(); } daBomb.redWire(); }
Indolering
source share