35 lines
863 B
C
35 lines
863 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
#define COLOR_RED 31
|
|
#define COLOR_BLACK 30
|
|
#define COLOR_GREEN 32
|
|
#define COLOR_BLUE 34
|
|
#define COLOR_YELLOW 33
|
|
#define COLOR_WHITE 37
|
|
#define COLOR_CYAN 36
|
|
#define COLOR_MAGENTA 35
|
|
|
|
//清屏
|
|
void clear_screen(void);
|
|
//清除从光标位置到行末的内容
|
|
void clear_to_end(void);
|
|
//光标移动到(x,y)
|
|
void cusor_moveto(int x, int y);
|
|
//保存光标位置
|
|
void cusor_get_pos(void);
|
|
//恢复光标位置
|
|
void cusor_set_pos(void);
|
|
//光标上移num行
|
|
void cusor_up(int num);
|
|
//光标下移num行
|
|
void cusor_down(int num);
|
|
//光标左移num个字符
|
|
void cusor_lift(int num);
|
|
//光标右移num个字符
|
|
void cusor_right(int num);
|
|
//设置前景颜色
|
|
void set_fg_color(int color);
|
|
//设置背景颜色
|
|
void set_bg_color(int color);
|