home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a014 / 1.ddi / CDBINC.EXE / SUB6.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-09-18  |  1.6 KB  |  91 lines

  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. #include<dos.h>
  4. #define pr(x) fprintf(fp,x)
  5.  
  6. /* change password */
  7. main()
  8. {
  9.   FILE *fp;
  10.   system("cls");
  11.   cursor(12,20);
  12.   color_puts("╒²╘┌╔·│╔╨▐╕─┐┌┴ε ,╟δ╔╘║≥!",14);
  13.   fp=fopen("setp.prg","w");
  14.   pr("clear\n");
  15.   pr("set safety off\nset color to W+/B\n");
  16.   pr("@2,2 say '┐┌ ┴ε ╨▐ ╕─'\n");
  17.   pr("do while .T.\nset color to W+/B\n");
  18.   pr("@10,20 say ' '\n");
  19.   pr("accept '                   ╟δ ╩Σ ╚δ ╨┬ ┐┌ ┴ε :  ' to password\n");
  20.   pr("pw=' '\n");
  21.   pr("do while pw<>'Y'.and.pw<>'N'\n");
  22.   pr("@20,20 say '─π ─▄ ╚╖ ╚╧ ┬≡?   (Y/N)' get pw picture '!' \n");
  23.   pr("read\n");
  24.   pr("enddo\nset color to W+/B\n");
  25.   pr("@20,0 say space(80)\n");
  26.   pr("if pw='Y'\n");
  27.   pr("exit\n");
  28.   pr("endif\n");
  29.   pr("enddo\n");
  30.   pr("save to word all like passwor?\n");
  31.   pr("set safety on\n");
  32.   pr("return\n");
  33.   fclose(fp);
  34. }
  35.  
  36.  
  37.  
  38.  
  39.  
  40. cursor(y,x)
  41. int x,y;
  42. {  union REGS inregs;
  43.    union REGS outregs;
  44.    inregs.h.ah=2;
  45.    inregs.h.bh=0;
  46.    inregs.h.dh=y;
  47.    inregs.h.dl=x;
  48.    int86(0x10,&inregs,&outregs);
  49. }
  50.  
  51.  
  52.  
  53. color_puts(s,color)
  54. char *s;
  55. int color;
  56. {  union REGS r;
  57.    int x,y,z;
  58.    now_cursor(&x,&z);
  59.    y=z;
  60.    while (*s)
  61.      {  if (*s=='\n')
  62.       {  s++;
  63.          x++;
  64.          y=z;
  65.          continue;
  66.       }
  67.     cursor(x,y);
  68.     r.h.ah=9;
  69.     r.h.al=*s++;
  70.     r.h.bl=color;
  71.     r.h.bh=0;
  72.     r.x.cx=1;
  73.     int86(0x10,&r,&r);
  74.     y++;
  75.     cursor(x,y);
  76.      }
  77.    return;
  78. }
  79.  
  80.  
  81. now_cursor(x,y)
  82. int *x,*y;
  83. {  union REGS r;
  84.    r.h.ah=3;
  85.    r.h.bh=0;
  86.    int86(0x10,&r,&r);
  87.    *x = r.h.dh;
  88.    *y = r.h.dl;
  89.    return;
  90. }
  91.