嘿,如何覆盖 c 中的字符?就像在 printf 语句中一样。 现在我想返回并用空格覆盖@并增加屏幕上的@。 我正在尝试实现贪吃蛇游戏。
#include<stdio.h>
#include<conio.h>
main()
{
printf("@");
}
最佳答案
您正在寻找的是 ANSI control characters .发送这些将允许您移动光标。
例如:
printf("%c[%dA", 0x1B, 10); // move cursor 10 lines up
关于c - 覆盖 printf 语句中的字符以实现 snake,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19229423/