#include <chrono>
#include <cstdlib>
#include <print>
#include <ranges>
#include <thread>

int main() {
  constexpr std::int32_t runs = 3;
  constexpr auto interval = std::chrono::seconds();

  for (std::int32_t i : std::views::iota(0, runs)) {
    std::print("\nLaunching: ./launcher/build/app (run {})\n", i + 1);

    std::int32_t result = std::system("./launcher/build/app");
    if (result != 0) {
      std::print("Run {} failed with code {}\n", i + 1, result);
    }

    std::this_thread::sleep_for(interval);
  }

  return 0;
}
