我正在使用 Xcode 并尝试向控制台显示彩色输出。它不起作用,我不知道为什么,我查看了其他堆栈溢出帖子并尝试了有效的代码。帮助表示赞赏!
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define ANSI_COLOR_RESET "\x1b[0m"
#define ANSI_COLOR_CYAN "\x1b[36m"
void dispWrongs(char guess, int wordLength);
int main(void) {
srand(time(NULL)); //sends a "seed" for random number generation
printf(ANSI_COLOR_CYAN " _ _ \n");
printf(ANSI_COLOR_CYAN " ___ ___ _ _ _ __ | |_ _ __(_) ___ ___ \n");
printf(ANSI_COLOR_CYAN " / __/ _ \\| | | | '_ \\| __| '__| |/ _ \\/ __\\ \n");
printf(ANSI_COLOR_CYAN "| (_| (_) | |_| | | | | |_| | | | __/\\__ \\ \n");
printf(ANSI_COLOR_CYAN " \\___\\___/ \\__,_|_| |_|\\__|_| |_|\\___||___/"ANSI_COLOR_RESET"\n");
return 0;
}