#include #include #include #include #include #include #include #include #include #define statx 13 #define staty 25 #define ESC 0x1b main() { /*--------------------------------------------------------------*/ /* Declaration segment */ char *menu_items[3]={ "File", "Edit", "About" }; int i,j,store, /*Store to save i when quitting to DOS Shell*/ delay_val=50; /*Delay value*/ struct { quit:1; /*Bitfield*//*quit status flag*/ redo:1; /*Ditto *//*redo do-while loop? flag*/ osshell:1; /*osshell flag*/ sts_msg:1; /*Status Message is being dispaled or not?*/ } flags; struct time t; char buffer[8], osshell[8], ch; /* Declaration ends here */ /*--------------------------------------------------------------*/ /*--------------------------------------------------------------*/ /* Initialization begins */ flags.quit=0; flags.osshell=0; flags.sts_msg=1; /* Initialization ends */ /*--------------------------------------------------------------*/ /*--------------------------------------------------------------*/ /* code segment begins */ do { if(!flags.osshell) { printf("\nEnter the delay value b/w colors in milliseconds\n\ \nPress enter for default value\n\ \nDelay : "); fflush(stdin); while(!kbhit()); if((ch=getch())!='\r') { ungetc(ch,stdin); putch(ch); scanf("%s",buffer); sscanf(buffer,"%d",&delay_val); } #if (defined(DEBUG) && DEBUG==1) printf("\nDelay_val=%d",delay_val); getch(); #endif } clrscr(); fillcolor(); navbar(); statusbar(); box(1,0,23,79,WHITE,BLUE); menus(3,menu_items); *((char far *)(0xB0008000+398)) = ' '; *((char far *)(0xB0008000+400)) = 'T'; gotoxy(10-strlen("color = "),10); printf("color = "); for(i=0;i<=255 && !(flags.quit);i++) { if(flags.osshell) { if(i