Guest User

Untitled

a guest
Aug 1st, 2014
328
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.26 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. rm a.out
  4. gcc -x c - -lncursesw <<EOF
  5. #include <stdio.h>
  6. #include <curses.h>
  7. #include <locale.h>
  8. int mi1,mi2,KWGT;
  9. char rstr[1000],rstr1[1000],rstr2[10000];
  10.  
  11. main(int argc,char **argv) {
  12.   setlocale(LC_ALL, "ru_RU.UTF-8");
  13.   initscr();
  14.   attrset(A_NORMAL);
  15.   erase();
  16.   start_color();
  17.   init_pair(1,COLOR_BLUE,COLOR_WHITE);
  18.   init_pair(2,COLOR_WHITE,COLOR_BLUE);
  19.   init_pair(3,COLOR_YELLOW,COLOR_BLUE);
  20.   init_pair(4,COLOR_BLACK,COLOR_WHITE);
  21.   keypad(stdscr,TRUE);
  22.   noecho();
  23.   nodelay(stdscr,TRUE);
  24.  
  25.   attrset(COLOR_PAIR(3));
  26.   attron(A_BOLD);
  27.   for(mi1=1;mi1<82;mi1++) {
  28.     rstr[mi1]=' ';
  29.     rstr1[mi1]=' ';
  30.     rstr2[mi1*3+0]=0xE2;
  31.     rstr2[mi1*3+1]=0x94;
  32.     rstr2[mi1*3+2]=0x80;
  33.   }
  34.   rstr2[0*3+0]=0xE2;
  35.   rstr2[0*3+1]=0x94;
  36.   rstr2[0*3+2]=0x8c;
  37.   rstr2[mi1*3+0-6]=0xE2;
  38.   rstr2[mi1*3+1-6]=0x94;
  39.   rstr2[mi1*3+2-6]=0x90;
  40.   rstr2[mi1*3]=0;
  41.   rstr1[mi1*3-1]=0;
  42.  
  43.   mvaddnstr(0,0,rstr2,mi1*3-2);
  44.  
  45.   sprintf(&rstr[0], "ВНИМАНИЕ - ATTENTION - 1,2,3 - А,Б,В,Г,Д,"
  46.     " а,б,в,г,д - A,B,C,D,E, a,b,c,d,e");
  47.   for(mi1=1;mi1<82;mi1++)
  48.     if(rstr[mi1]==0)
  49.       rstr[mi1]=' ';
  50.   mvaddnstr(1,1,rstr,78);
  51.  
  52.   a2:
  53.     refresh();
  54.   a1:
  55.     KWGT=wgetch(stdscr);
  56.   if(KWGT==ERR)
  57.     goto a1;
  58. }
  59. EOF
  60. ./a.out
Advertisement
Add Comment
Please, Sign In to add comment