//颜色初始化 if(!has_colors() || start_color() == ERR){ endwin() printf("Terminal does not support color.\n") exit(1) } init_pair(1, COLOR_GREEN, COLOR_BLACK) init_pair(2, COLOR_RED, COLOR_BLACK) init_pair(3, COLOR_CYAN, COLOR_BLACK) init_pair(4, COLOR_WHITE, COLOR_BLACK) init_pair(5, COLOR_MAGENTA, COLOR_BLACK) init_pair(6, COLOR_BLUE, COLOR_BLACK) init_pair(7, COLOR_YELLOW, COLOR_BLACK) //写字符串 for(i = 1 i <= 7 i++) { attron(COLOR_PAIR(i)) printw("color pair d in normal mode\n", i) } for(i = 1 i <= 7 i++) { attron(COLOR_PAIR(i) | A_BLINK | A_UNDERLINE) printw("color pair d in normal mode\n", i) }
标签: start_color has_colors Terminal endwin
上传时间: 2014-01-14
上传用户:vodssv
//初始化 if(initscr() == NULL) { perror("initcurs") exit(EXIT_FAILURE) } cbreak() noecho() keypad(stdscr, TRUE) //建立菜单项 for(i=0 i<N_ITEMS i++){ items[i] = new_item(months[i], "") } //建立菜单 mymenu = new_menu(items) //设置为5行单列的菜单 set_menu_format(mymenu, 5, 1) set_menu_mark(mymenu, "*") //获得菜单的行数很列数 scale_menu(mymenu, &mrows, &mcols) //建立窗口和子窗口 win = newwin(mrows + 2, mcols + 2, 3, 30) keypad(win, TRUE) box(win, 0, 0) subwin = derwin(win, 0, 0, 1, 1) //设置菜单的窗口 set_menu_sub(mymenu, subwin) //在子窗口上放置菜单 post_menu(mymenu) refresh() wrefresh(win)
标签: EXIT_FAILURE initcurs initscr cbreak
上传时间: 2013-11-29
上传用户:小眼睛LSL
C++ C 词法分析器,编译原理, 运行时输入文件(input.txt)路径,文件内容为{}BEGIN FOR(I=0 I<10 I=I+1){} END
标签: 分析器
上传时间: 2013-12-18
上传用户:mikesering
参考课堂迷宫问题的解题方法,建立move数组,若马当前位置是(x,y),则沿着第i(1<=i<=8)个方向跳一步,到达新的位置为( x’,y’),下表位置可以根据 move 数组来确定,有: x’=x+move[i][0] y’=y+move[i][1]. 马走过的信息的 用结构体来存储。move数组用于存储马可以走过的方向,将开始的马的位置的信息存入队列,马沿着8个方向跳动,在马跳动过程中,将马的跳动步数加1,如果马没有走到边界,判断马有没有在走同样的步数到同一个节点。如果马没有在同样的步数到同一个节点,则将这个节点的信息存入队列的对尾。在解题中,使用顺序队列来记录马到达的位置。使用队首指针来记录对首元素。将马走过的位置的信息存入队列中,当该节点走完8个方向时,就将该节点从对列中删除掉。直到走的步数为指定的步数时结束。
标签: 迷宫
上传时间: 2013-12-12
上传用户:cooran
java 线程 静态锁,对象锁, synchronized 是锁方法还是锁对象?还是锁类?如何实现?? 部分代码如下, public static Object lock=new Object() //静态锁,锁类,不是锁对象了!!所以两个线程同时 运行两个 TestThread 的execute( ),也可以同步!!! public void execute(){ // synchronized(lock){ for(int i=0 i<20 i++){ try { Thread.sleep(30) } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace() } System.out.println(Thread.currentThread().getName()+Thread.currentThread ().getName()+" "+i) } } }
上传时间: 2017-07-15
上传用户:lijianyu172
PIC16C63单片机UART通信——A机读取时钟芯片DS1302获得当前时间,通过UART通信传给B机,B机使用LCD1602显示当前时间
上传时间: 2013-11-30
上传用户:shanml
第一章JSP简介 例子1(效果如图1.1所示) Example1_1.jsp: < @ page contentType="text/html charset=GB2312" > <HTML> <BODY BGCOLOR=cyan> <FONT Size=1> <P>这是一个简单的JSP页面 < int i, sum=0 for(i=1 i<=100 i++) { sum=sum+i } >
标签: contentType Example charset 2312
上传时间: 2017-08-31
上传用户:zycidjl
•ARINC429总线协议是美国航空电子工程委员会(Airlines Engineering Committee)于1977年7月提出的,并于同年发表并获得批准使用,它的全称是数字式信息传输系统(Digital Information Transmission System ) 。协议标准规定了航空电子设备及有关系统间的数字信息传输要求。ARINC429广泛应用在先进的民航客机中,如B-737、B-757、B-767,俄制军用飞机也选用了类似的技术。
标签: ARINC429 总线
上传时间: 2015-03-25
上传用户:423619775
A design about 8051 (running at 12MHz) based system with 3 7-Seg displays and two buttons to implement the following functions. 1. When press the + button, the display C = A+B. 2. When press the button, the display C = A - B. “A” and “B” are 8-bit inputs when “C” is 9-bit output.
上传时间: 2015-05-05
上传用户:guoxiy
My JSP 'TeacherMain.jsp' starting page var $=function(id) { return document.getElementById(id); } function show_menu(num){ for(i=0;i
标签: C++
上传时间: 2015-07-03
上传用户:xiyuzhu