function printMessage(
  message: string,
  color: string = "32",
  isBold: boolean = false,
  center: boolean = false
): void {
  const consoleWidth: number = process.stdout.columns || 80;
  const formattedMessage: string = center
    ? " ".repeat(Math.floor((consoleWidth - message.length) / 2)) + message
    : message;
  const boldCode: string = isBold ? "\x1b[1m" : "";
  const colorCode: string = `\x1b[${color}m`;
  console.log(`${boldCode}${colorCode}${formattedMessage}\x1b[0m`);
}

function printAsciiArt(art: string): void {
  const lines: string[] = art.split("\n");
  lines.forEach((line) => printMessage(line, "32", true, true));
}

export { printAsciiArt, printMessage };
