简单的,通过代码,实现光标的移动和定位
来源:互联网 发布:长征5号失败知乎 编辑:程序博客网 时间:2024/05/21 09:40
#include <stdio.h> #include <unistd.h> // 清除屏幕 #define CLEAR() printf("\033[2J") // 上移光标 #define MOVEUP(x) printf("\033[%dA", (x)) // 下移光标 #define MOVEDOWN(x) printf("\033[%dB", (x)) // 左移光标 #define MOVELEFT(y) printf("\033[%dD", (y)) // 右移光标 #define MOVERIGHT(y) printf("\033[%dC",(y)) // 定位光标 #define MOVETO(x,y) printf("\033[%d;%dH", (x), (y)) // 光标复位 #define RESET_CURSOR() printf("\033[H") // 隐藏光标 #define HIDE_CURSOR() printf("\033[?25l") // 显示光标 #define SHOW_CURSOR() printf("\033[?25h") //反显 #define HIGHT_LIGHT() printf("\033[7m") #define UN_HIGHT_LIGHT() printf("\033[27m") int main(int argc,char **argv) { printf("\033[31mThe color,%s!\033[1m\n","haha"); printf("\033[31mThe color,%s!\033[4m\n","haha"); printf("\033[31mThe color,%s!\033[5m\n","haha"); printf("\033[31mThe color,%s!\033[7m\n","haha"); printf("\033[31mThe color,%s!\033[8m\n","haha"); printf("\033[31mThe color,%s!\033[0m\n","haha"); printf("\033[47;31mThe color,%s!\033[0m\n","haha"); printf("\033[47mThe color,%s!\033[0m\n","haha"); sleep(2); printf("\033[47m%s!\033[5A\n","up 5"); sleep(2); printf("\033[47m%s!\033[9B\n","down 9"); sleep(2); printf("\033[47m%s!\033[19C\n","right 19"); printf("right19"); sleep(2); printf("\033[47m%s!\033[10D\n","left 10"); printf("left 10"); sleep(2); printf("\033[47m%s!\033[50;20H\n","move to y:50,x 20"); printf("y50 x 20"); sleep(2); printf("\033[47m%s!\033[?25l\n","hide cursor"); sleep(2); printf("\033[47m%s!\033[?25h\n","sow cursor"); sleep(2); printf("\033[47m%s!\033[2J\n","clear scleen"); sleep(2); system("reset");return 0; }
0 0
- 简单的,通过代码,实现光标的移动和定位
- 用代码实现光标的移动
- 用JavaScript实现的文本框光标定位
- JavaScript与Div对层定位和移动获得坐标的实现代码
- 光标移动的函数
- textarea的光标移动
- 移动光标的WINAPI
- Edittext 的光标移动
- vim的光标移动
- MFC 实现窗口随光标的移动而移动
- c++ 光标移动定位
- LinuxC\C++实现终端界面中光标的定位和清屏操作
- 蒙特卡洛移动定位算法的代码
- C语言的光标定位
- editView光标的位置定位
- Windows CE: 通过Application实现对鼠标光标的隐藏和显示的控制
- OO ALV 光标定位单元格的行和列
- mysql数据库“光标”移动机制实现的分页查询
- SVN的部署以及基本操作
- ViewController改变View界面的button值时问题
- ExtJs6.0 总结(1)
- MathJax笔记-精简打印版
- Android源码目录结构详解
- 简单的,通过代码,实现光标的移动和定位
- Error:Execution failed for task ':app:mergeDebugResources'. > Error: Java.util.concurrent.ExecutionE
- NSDate 总结
- inux安装Mysql步骤+Navicat Premiun连接虚拟机mysql+mysql常用命令集+mysql常用操作
- 桥接模式和适配器模式的区别
- Objective - C 进行代码混淆
- Java设计模式----命令模式(command)
- android用户空间的启动过程
- eclipes的SVN插件的配置问题