Hello friends
here i present a simple address diary program
that store name, phone number,sunsigh,best moment date of birth and place,and also hobby of a person....
When you run this u must fill password
and password is "hello"...
I think you will enjoy it..............
To manage address diary and many more
//AUTHOR SURENDER BHYAN
//JMIT RADAUR
#include<process.h>
#include<iostream.h>
#include<graphics.h>
#include<conio.h>
#include<dos.h>
#include<stdio.h>
#include<string.h>
#include<fstream.h>
#define True 1
#define False 0
void flv();
GetChar(int,int);
void PutChar(char,int,int);
void DropChar(int,int);
void RaiseChar(int,int);
void MakeSound();
void help_matter();
void memory();
void location();
void sw();
void r();
void end();
void begin();
void snd();
void low_snd();
void endsnd();
void pass();
void dark();
void append();
void creation();
void reading();
int lastrecord();
void sound();
void deletion();
int date_time();
int Row,Col,I,WasBlank;
void main()
{
_setcursortype(_NOCURSOR);
dark();
begin();
pass();
system("AF.BAT");
window(1,1,80,1);
textcolor(10);
textbackground(1);
clrscr();
//cprintf(" COPY RIGHT(s) OWNED BY ' NAVDEEP ' PRODUCTIONS");
window(1,5,80,5);
textcolor(10);
textbackground(1);
clrscr();
date_time();
for(int t=5;t<=40;t++)
{
window(40-t,2,41+t,4);
textcolor(11);
textbackground(5);
clrscr();
sound(50);
delay(10);
nosound();
}
for(int r=0;r<=239;r++)
//
printf("°");
// gotoxy(35,1);cout<<"~ NAVDEEP ~";
gotoxy(28,2);cout<<"~ P R E S E N T ~";
gotoxy(24,3);cout<<"ì ì ì S O F T W A R E O N ì ì ì";
sw();
int flag;
getch();
do
{
_setcursortype(_NOCURSOR);
for(t=0;t<=12;t++)
{
window(32,6,46,6+t);
textcolor(2);
textbackground(1);
clrscr();
sound(50);
delay(10);
}
nosound();
cout<<"ÛÛ MAIN MENU ÛÛ"; delay(10);
cout<<"\n\t\t\t ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ";delay(10);
cout<<"\n\n\t\t\t 1¯¯ CREATE"; delay(10);
cout<<"\n\t\t\t 2¯¯ VIEW"; delay(10);
cout<<"\n\t\t\t 3¯¯ APPEND"; delay(10);
cout<<"\n\t\t\t 4¯¯ DELETE"; delay(10);
// cout<<"\n\t\t\t 5¯¯ UPDATE"; delay(10);
cout<<"\n\t\t\t 6¯¯ MEMORY";delay(10);
cout<<"\n\t\t\t 7¯¯ HELP"; delay(10);
cout<<"\n\t\t\t 8¯¯ EXIT"; delay(10);
// cout<<"\n\t\t\t 9¯¯ HANG";
int i=10;
i=getch();
for(t=0;t<=12;t++)
{
window(32,6,46,6+t);
textcolor(0);
textbackground(0);
clrscr();
sound(50);
delay(10);
}
nosound();
flag=0;
switch(i)
{
case '1' :
const char ESC=27;
const char ENTER=13;
snd();
begining:
for(int g=1;g<=18;g++)
{
window(38-g,10,38+g,13);
textcolor(15);
textbackground(1);
clrscr();
sound(50);
delay(10);
}
nosound();
cprintf("\r WARNING:THIS OPTION WILL DESTROYED");
cprintf("\n\r the present stored records");
cprintf("\n\r press ENTER to continue");
cprintf("\n\r and ESC to abort...");
int u;
u=getch();
putch(u);
if(u==ESC)
{
dark();
snd();
}
else
{
if(u==ENTER)
{
dark();
snd();
creation();
snd();
}
else
{
snd();snd();sound(2500);delay(100);
sound(2000);delay(100);
nosound();
goto begining;
}
}
break;
case '2' :
snd();
reading();
snd();
break;
case '3' :
snd();
append();
snd();
break;
case '4' :
snd();
deletion();
snd();
break;
case '5' :
snd();
location();
snd();
break;
case '6' :
snd();
memory();
snd();
break;
case '7' :
snd();
help_matter();
snd();
break;
case '8' :
snd();
beg:
for(g=1;g<=18;g++)
{
window(38-g,10,38+g,12);
textcolor(14);
textbackground(4);
clrscr();
sound(50);
delay(10);
}
nosound();
cprintf("\n\r Do you really want to quit(y/n):");
int w;
w=getch();
putch(w);
if(w=='n'||w=='N')
{
getch();
dark();
snd();
}
else
{
if(w=='y'||w=='Y')
{
getch();
dark();
textmode(C40);
textcolor(3);
textbackground(6);
clrscr();
_setcursortype(_NOCURSOR);
end();
textcolor(13+128);
textbackground(0);
clrscr();
gotoxy(9,2);
cout<<"!! GOOD BYE , FRIENDS !!";
low_snd();
gotoxy(10,13);
// cout<<" BY NAVDEEP ";
gotoxy(2,24);
cout<<"Press CTRL_END to end the software...";
gotoxy(14,16);
cout<<" ";
const char CTRL_END=117;
int q;
do
{
q=getch();
}
while(q!=CTRL_END);
textcolor(6);
textbackground(0);
clrscr();
gotoxy(16,12);
cout<<" THE END ";
sound();
flag++;
}
else
{
snd();snd();sound(2500);delay(100);
sound(2000);delay(100);
nosound();
goto beg;
}
}
break;
case '9' :
snd();
begin:
for(g=1;g<=18;g++)
{
window(38-g,10,38+g,11);
textcolor(0);
textbackground(15);
clrscr();
sound(50);
delay(10);
}
nosound();
cprintf(" WARNING::This option will hang your");
cprintf("\n\r system. Are you ready(y/n)::");
int v;
v=getch();
putch(v);
if(v=='n'||v=='N')
{
getch();
dark();
snd();
}
else
{
if(v=='y'||v=='Y')
{
getch();
flv();
dark();
}
else
{
snd();snd();sound(2500);delay(100);
sound(2000);delay(100);
nosound();
goto begin;
}
}
break;
default:
snd();snd();
sound(2500);delay(100);
sound(2000);delay(100);
nosound();
for(g=1;g<=21;g++)
{
window(38-g,12,39+g,13);
textcolor(14);
textbackground(4);
clrscr();
sound(50);
delay(10);
}
nosound();
textcolor(0);
textbackground(3);
clrscr();
cout<<" Do not press any key which is not required.";
cout<<"\n\t press ESC key ... ";
char s;
do
{
s=getch();
cout<<"";
}
while(s!=ESC);
dark();
snd();
break;
}
}
while(!flag);
}
void creation()
{
poke(0x0000,0x417,64); // set CAPSLOCK on
_setcursortype(_SOLIDCURSOR);
struct student
{
char b_day[11],hobby[20],best[25];
int sr_no;
char name[25],zord[15],place[15];
char phone[20];
};
student record;
int size;
char ans;
for(int c=0;c<=12;c++)
{
window(1,8,26,8+c);
textcolor(1);
textbackground(2);
clrscr();
sound(50);
delay(10);
}
nosound();
clrscr();
record.sr_no=0;
ofstream bfile("rah.dat",ios::binary|ios::out);
int i=0;
do
{
textcolor(i++);
textbackground(i+3);
clrscr();
cout<<"\n ADDRESS ";
cout<<"\n SR_NO.¯ ";cout<<++record.sr_no;
gotoxy(1,3); cout<<"\n NAME¯ ";gotoxy(8,4);gets(record.name);
gotoxy(1,4); cout<<"\n SUNSIGN¯ ";gotoxy(11,5);gets(record.zord);
gotoxy(1,5); cout<<"\n PHONE NO.¯ ";gotoxy(13,6);gets(record.phone);
gotoxy(1,6); cout<<"\n B'DAY DATE¯ ";gotoxy(14,7);gets(record.b_day);
gotoxy(1,7); cout<<"\n PLACE¯ ";gotoxy(9,8);gets(record.place);
gotoxy(1,8); cout<<"\n HOBBY¯ ";gotoxy(9,9);gets(record.hobby);
gotoxy(1,9); cout<<"\n BEST PAL¯ ";gotoxy(12,10);gets(record.best);
bfile.write((char*)&record,sizeof(student));
gotoxy(3,24);cout<<"\nCREATE MORE RECORD:(y/n)";
cin>>ans;
}
while (ans=='y'||ans=='Y');
bfile.close();
for(c=0;c<=12;c++)
{
window(1,8,26,8+c);
textcolor(0);
textbackground(0);
clrscr();
sound(50);
delay(10);
}
nosound();
}
void reading()
{
poke(0x0000,0x417,64); // set CAPSLOCK on
_setcursortype(_SOLIDCURSOR);
struct student
{
char b_day[11],hobby[20],best[25];
int sr_no;
char name[25],zord[15],place[15];
char phone[20];
};
student record;
int size;
char ans;
for(int c=0;c<=12;c++)
{
window(1,8,26,8+c);
textcolor(1);
textbackground(2);
clrscr();
sound(50);
delay(10);
}
nosound();
ifstream ifile;
ifile.open("rah.dat",ios::binary|ios::in);
if(!ifile)
{
cout<<"cannot open the file";
}
size=sizeof(student);
clrscr();
char ch;
ifile.read((char*)&record,size);
int n;
n=0;
do
{
textcolor(n++);
textbackground(n+3);
clrscr();
cout<<"\n ADDRESS \n";
int y=wherey();
gotoxy(1,y++); cout<<"SERIAL NO.¯ "<<record.sr_no;
gotoxy(1,y++); cout<<"NAME¯ "<<record.name;
gotoxy(1,y++); cout<<"SUNSIGN¯ "<<record.zord;
gotoxy(1,y++); cout<<"PHONE NO.¯ "<<record.phone;
gotoxy(1,y++); cout<<"B'DAY DATE¯ "<<record.b_day;
gotoxy(1,y++); cout<<"PLACE¯ "<<record.place;
gotoxy(1,y++); cout<<"HOBBY¯ "<<record.hobby;
gotoxy(1,y++); cout<<"BEST PAL¯ "<<record.best;
ifile.read((char*)&record,size);
cout<<"\n\nREAD NEXT RECORD(y/n):";
cin>>ch;
}
while(ifile&&(ch=='y'||ch=='Y'));
ifile.close();
for(c=0;c<=12;c++)
{
window(1,8,26,8+c);
textcolor(0);
textbackground(0);
clrscr();
sound(50);
delay(10);
}
nosound();
}
void append()
{
poke(0x0000,0x417,64); // set CAPSLOCK on
for(int c=0;c<=12;c++)
{
window(1,8,26,8+c);
textcolor(1);
textbackground(2);
clrscr();
sound(50);
delay(10);
}
nosound();
_setcursortype(_SOLIDCURSOR);
struct student
{
char b_day[11],hobby[20],best[25];
int sr_no;
char name[25],zord[15],place[15];
char phone[20];
};
student record;
int size,last=0;
last=lastrecord();
char ans;
window(1,8,26,20);
clrscr();
int n;
n=0;
ofstream bfile("rah.dat",ios::binary|ios::app);
do
{
textcolor(n++);
textbackground(n+3);
clrscr();
cout<<"\n ADDRESS ";
cout<<"\n SR_NO.¯ ";cout<<last;
record.sr_no=last;
gotoxy(1,3); cout<<"\n NAME¯ ";
gotoxy(8,4); gets(record.name);
gotoxy(1,4); cout<<"\n SUNSIGN¯ ";
gotoxy(11,5); gets(record.zord);
gotoxy(1,5); cout<<"\n PHONE NO.¯ ";
gotoxy(13,6); gets(record.phone);
gotoxy(1,6); cout<<"\n B'DAY DATE¯ ";
gotoxy(14,7); gets(record.b_day);
gotoxy(1,7); cout<<"\n PLACE¯ ";
gotoxy(9,8); gets(record.place);
gotoxy(1,8); cout<<"\n HOBBY¯ ";
gotoxy(9,9); gets(record.hobby);
gotoxy(1,9); cout<<"\n BEST PAL¯ ";
gotoxy(12,10); gets(record.best);
bfile.write((char*)&record,sizeof(student));
cout<<"\nAPPEND MORE RECORD:(y/n)";
cin>>ans;
last++;
}
while(bfile&&(ans=='y'||ans=='Y'));
bfile.close();
for(c=0;c<=12;c++)
{
window(1,8,26,8+c);
textcolor(0);
textbackground(0);
clrscr();
sound(50);
delay(10);
}
nosound();
}
void deletion()
{
poke(0x0000,0x417,64); // set CAPSLOCK on
for(int c=1;c<=12;c++)
{
window(1,8,26,8+c);
textcolor(1);
textbackground(2);
clrscr();
sound(50);
delay(10);
}
nosound();
_setcursortype(_SOLIDCURSOR);
struct student
{
char b_day[11],hobby[20],best[25];
int sr_no;
char name[25],zord[15],place[15];
char phone[20];
};
student record;
int size;
char ans;
int flag=1;
window(1,8,26,20);
ifstream xfile;
ofstream nfile;
xfile.open("rah.dat",ios::binary|ios::in);
nfile.open("new.dat",ios::binary|ios::out);
if(!xfile)
{
cout<<"cannot open the file";
}
int counter=0;
size=sizeof(student);
clrscr();
char ch;
xfile.read((char*)&record,size);
int n;
n=0;
do
{
textcolor(n++);
textbackground(n+3);
clrscr();
cout<<"\n ADDRESS \n";
int y=wherey();
gotoxy(1,y++); cout<<" SERIAL NO.¯ "<<record.sr_no;
gotoxy(1,y++); cout<<" NAME¯ "<<record.name;
gotoxy(1,y++); cout<<" SUNSIGN¯ "<<record.zord;
gotoxy(1,y++); cout<<" PHONE NO.¯ "<<record.phone;
gotoxy(1,y++); cout<<" B'DAY DATE¯ "<<record.b_day;
gotoxy(1,y++); cout<<" PLACE¯ "<<record.place;
gotoxy(1,y++); cout<<" HOBBY¯ "<<record.hobby;
gotoxy(1,y++); cout<<" BEST PAL¯ "<<record.best;
cout<<"\n\n DELETE A RECORD(y/n):";
cin>>ch;
if(ch=='N'||ch=='n')
{
nfile.write((char*)&record,size);
flag =0;
}
xfile.read((char*)&record,size);
}
while(xfile);
xfile.close();
nfile.close();
if(flag==0)
{
ifstream x1file;
ofstream n1file;
x1file.open("new.dat",ios::binary|ios::in);
n1file.open("rah.dat",ios::binary|ios::out);
if(!x1file)
{ cout<<"cannot open the file";
}
counter=0;
x1file.read((char*)&record,sizeof(student));
do
{ record.sr_no=++counter;
n1file.write((char*)&record,sizeof(student));
x1file.read((char*)&record,sizeof(student));
}
while(x1file);
x1file.close();
n1file.close();
}
for(c=0;c<=12;c++)
{
window(1,8,26,8+c);
textcolor(0);
textbackground(0);
clrscr();
sound(50);
delay(10);
}
nosound();
}
int lastrecord()
{
struct student
{
char b_day[11],hobby[20],best[25];
int sr_no;
char name[25],zord[15],place[15];
char phone[20];
};
student record;
int size,counter=0;
ifstream lastfile;
lastfile.open("rah.dat",ios::binary|ios::in);
size=sizeof(student);
lastfile.read((char*)&record,size);
do
{
counter=record.sr_no;
lastfile.read((char*)&record,size);
}
while(lastfile);
lastfile.close();
return ++counter;
}
void location()
{
poke(0x0000,0x417,64); // set CAPSLOCK on
_setcursortype(_SOLIDCURSOR);
struct student
{
char b_day[11],hobby[20],best[25];
int sr_no;
char name[25],zord[15],place[15];
char phone[20];
};
student record;
int size;
for(int g=1;g<=18;g++)
{
window(38-g,11,38+g,11);
textcolor(14);
textbackground(4);
clrscr();
sound(50);
delay(10);
}
nosound();
textcolor(2);
textbackground(1);
clrscr();
cout<<"ENTER THE SR_NO. TO BE UPDATED::";
int srno;
cin>>srno;
dark();
snd();
fstream infile("rah.dat",ios::binary|ios::in|ios::out|ios::ate);
int location=(srno-1) * sizeof(student);
if (infile.eof())
infile.clear();
infile.seekp(location);
for(int c=0;c<=12;c++)
{
window(1,8,26,8+c);
textcolor(1);
textbackground(2);
clrscr();
sound(50);
delay(10);
}
nosound();
textcolor(0);
textbackground(4);
cout<<"\n1.NAME ";
cout<<"\n2.SUNSIGN";
cout<<"\n3.PHONE NO:";
cout<<"\n4.B'DAY DATE";
cout<<"\n5.PLACE ";
cout<<"\n6.HOBBY";
cout<<"\n7.BEST PAL";
cout<<"\n8. EXIT";
int T;
cout<<"\nENTER DATA TO UPDATED:";
cin>>T;
clrscr();
cout<<"\n ADDRESS ";
cout<<"\n SR_NO.¯ "<< srno;
switch(T)
{
case 1: gotoxy(1,3); cout<<"\n NAME¯ ";
gotoxy(8,4); gets(record.name);
break;
case 2: gotoxy(1,4); cout<<"\n SUNSIGN¯ ";
gotoxy(11,5); gets(record.zord);
break;
case 3: gotoxy(1,5); cout<<"\n PHONE NO.¯ ";
gotoxy(13,6); gets(record.phone);
break;
case 4:
gotoxy(1,6); cout<<"\n B_DAY DATE¯ ";
gotoxy(14,7); gets(record.b_day);
break;
case 5:
gotoxy(1,7); cout<<"\n PLACE¯ ";
gotoxy(9,8); gets(record.place);
break;
case 6:
gotoxy(1,8); cout<<"\n HOBBY¯ ";
gotoxy(7,6); gets(record.hobby);
case 7:
gotoxy(1,9); cout<<"\n BEST PAL¯ ";
gotoxy(12,10); gets(record.best);
break;
case 8: exit(0);
break;
default: cout<<"RECORD NOT FOUND";
}
record.sr_no=srno;
infile.write((char*)&record,sizeof(student));
infile.close();
for(c=0;c<=12;c++)
{
window(1,8,26,8+c);
textcolor(0);
textbackground(0);
clrscr();
sound(50);
delay(10);
}
nosound();
}
void memory()
{ _setcursortype(_SOLIDCURSOR);
for(int g=1;g<=18;g++)
{
window(38-g,10,38+g,12);
textcolor(14);
textbackground(4);
clrscr();
sound(50);
delay(10);
}
nosound();
textcolor(1);
textbackground(5);
clrscr();
struct student
{
char b_day[11],hobby[20],best[25];
int sr_no;
char name[25],zord[15],place[15];
char phone[20];
};
student record;
fstream infile("rah.dat",ios::binary|ios::in|ios::out|ios::ate);
infile.seekg(0,ios::end);
int msize=infile.tellg();
int rsize=msize/sizeof(student);
_setcursortype(_NOCURSOR);
cprintf(" TOTAL NO. OF RECORDS::");
cout<<rsize;
cprintf("\n\r TOTAL MEMORY CONSUMED::");
cout<<msize;
cout<<" Bytes";
cprintf("\n\r press ENTER to continue...");
const char ENTER=13;
int e;
do
{
e=getch();
}
while(e!=ENTER);
dark();
}
void sound()
{
sound(800); delay(100); sound(750);
delay(100); sound(700); delay(100);
sound(650); delay(100); sound(600);
delay(100); sound(550); delay(100);
sound(500); delay(100); sound(450);
delay(100); sound(400); delay(100);
sound(350); delay(100); sound(300);
delay(100); sound(250); delay(100);
sound(200); delay(100); nosound();
}
void begin()
{
textcolor(9);
textbackground(0);
clrscr();
r();
sound();
gotoxy(25,18);
//cout<<" N A V D E E P C R E A T I O N S";
gotoxy(28,20);
cout<<"P R E S E N T S ";
gotoxy(33,22);
cout<<" ÷";
getch();
clrscr();
textmode(C40);
textcolor(14);
textbackground(0);
clrscr();
_setcursortype(_NOCURSOR);
cout<<"\n\t SOFTWARE ON ¯¯";
cout<<"\n"; int x=0;
char * string1=" ADDRESS ";
for(int l=0;l<10;l++)
{
cout<<"\n\t ";
sound(2000+x);
delay(100);
sound(2500+x);
delay(100);
x=x+200;
cout.write(string1,l);
}
cout<<" DIARY";
for(l=8;l>=0;l--)
{
cout<<"\n\t ";
sound(3600-x);
delay(100);
sound(3100-x);
delay(100);
x=x-200;
cout.write(string1,l);
}
nosound();
getch();
clrscr();
textmode(C80);
}
void end()
{
textcolor(10);
textbackground(0);
clrscr();
int s;
for (s=0;s<=24;s++)
{
gotoxy(9,25-s);
cout<<"!! GOOD BYE , FRIENDS !!";//good bye , friends !";
delay(100);
clrscr();
}
sound();
textcolor(12);
textbackground(0);
clrscr();
for(s=0;s<=17;s++)
{
gotoxy(18-s,12);
//cout<<" ";
sound(50);
delay(100);
nosound();
clrscr();
}
}
void endsnd()
{
sound(1000); delay(10); sound(800);
delay(10); sound(600); delay(10);
sound(400); delay(10); sound(200);
delay(10); sound(100); delay(10);
sound(1000); delay(10); sound(800);
delay(10); sound(600); delay(10);
sound(400); delay(10); sound(200);
delay(10); sound(100); delay(100);
nosound();
}
void r()
{
int i,t;
for(i=1;i<=12;i++)
{
gotoxy(21,18-i);
delay(100);
cout<<"ÛÛ";
}
for(i=1;i<=10;i++)
{
gotoxy(21+i,6);
delay(100);
cout<<"Û";
}
for(i=1;i<=6;i++)
{
gotoxy(31,5+i);
delay(100);
cout<<"ÛÛ";
}
for(i=1;i<=9;i++)
{
gotoxy(31-i,11);
delay(100);
cout<<"Û";
}
for(t=1;t<=7;t++)
{
gotoxy(31,10+t);
delay(100);
cout<<"ÛÛ";
}
for(i=1;i<=11;i++)
{
gotoxy(41,17-i);
delay(100);
cout<<"ÛÛ";
}
for(i=1;i<=11;i++)
{
gotoxy(39+i,6);
delay(100);
cout<<"Û";
}
for(i=1;i<=12;i++)
{
gotoxy(51,5+i);
delay(100);
cout<<"ÛÛ";
}
for(i=1;i<=11;i++)
{
gotoxy(51-i,17);
delay(100);
cout<<"Û";
}
}
void dark()
{
textcolor(3);
textbackground(0);
clrscr();
}
void sw()
{
window(31,5,47,5);
textcolor(0+128);
textbackground(2);
clrscr();
cout<<" ADDRESS DIARY";
}
void help_matter()
{
for(int n=0;n<=18;n++)
{
window(17,6,63,6+n);
textcolor(0);
textbackground(6);
clrscr();
sound(50);
delay(10);
nosound();
}
cout<<"\t\t HELP MENU";
cprintf("\n\rßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß");
cprintf("\r Welcome to the help menu of ADDRESS DIARY");
cprintf("\n\r Every measures are provided in this software");
cprintf("\n\r to make it user friendly.The thing which you");
cprintf("\n\r have to do is to move according to the given");
cprintf("\n\r instrustions.This software provides many ");
cprintf("\n\r facilities such as creating,reading,appending");
cprintf("\n\r deleting,setting time and date of execution");
cprintf("\n\r modifying,detecting memory consumption and");
cprintf("\n\r many types of sounds are provided to make");
cprintf("\n\r the software more interesting.It stores the");
cprintf("\n\r records in a data file named 'rah.doc'.It");
cprintf("\n\r also needs one data file named 'new.dat for");
cprintf("\n\r deleting purposes.Handle with care and do not");
cprintf("\n\r press any key which is not required..");
cprintf("\n\n\r press ESC to exit....");
const char ESC=27;
char s;
do
{
s=getch();
cout<<"";
}
while(s!=ESC);
for(int c=0;c<=18;c++)
{
window(17,6,63,6+c);
textcolor(0);
textbackground(0);
clrscr();
sound(50);
delay(10);
}
nosound();
}
void pass()
{
beg:
_setcursortype(_NOCURSOR);
char *password;
int g,h;
for(h=1;h<=3;h++)
{
window(25,12-h,55,12+h);
textcolor(0);
textbackground(1);
delay(100);
clrscr();
}
for(g=1;g<=13;g++)
{
window(40-g,11,40+g,13);
textcolor(2);
textbackground(4);
sound(50);
delay(100);
nosound();
clrscr();
}
int xpos=wherex();
int ypos=wherey();
cprintf("\n");
low_snd();
while(strcmp(password,"hello")!=0)
{
gotoxy(xpos+5,ypos+1);
password=getpass("Enter password:");
}
dark();
}
void low_snd()
{
sound(10000); delay(100); sound(8000);
delay(100); sound(6000); delay(100);
sound(4000); delay(100); sound(2000);
delay(100); sound(1000); delay(100);
sound(800); delay(100); sound(600);
delay(100); sound(400); delay(100);
sound(200); delay(100); sound(100);
delay(100); nosound();
}
void snd()
{
sound(3500);delay(100);sound(3000);
delay(100);sound(2500);delay(100);
nosound();
}
int date_time()
{
clrscr();
struct dosdate_t d;
{
unsigned char day;
unsigned char month;
unsigned int year;
unsigned char dayofweek;
};
_dos_getdate(&d);
printf(" Current date is %d",d.day);
printf("/%d",d.month);
printf("/%d",d.year);
struct dostime_t t;
{
unsigned char hour;
unsigned char minute;
unsigned int second;
unsigned char hsecond;
};
_dos_gettime(&t);
printf(" Current time is %2d:%02d:%02d.%02d\n",
t.hour,t.minute,t.second,t.hsecond);
return 0;
}
void flv()
{
char C;
union REGS regs;
for(Col =0;Col>=0;Col--)
{
if (GetChar(Col,24)==' ')
continue;
PutChar(' ',Col,24);
}
for(Row=23;Row>0;Row--)
for(Col=80;Col>=0;Col--)
DropChar(Col,Row);
}
void PutChar(char C,int Col,int Row)
{
pokeb(0xb800,(Row*160+(Col-1)*2),C);
}
GetChar(int Col,int Row)
{
return peekb(0xb800,(Row*160+(Col-1)*2));
}
void BounceChar(int WhichCol,int Row)
{
char C;
int HalfHeight = (24-Row)/2;
if (HalfHeight == 0)
{
PutChar(178,WhichCol,24);
return ;
}
RaiseChar(WhichCol,HalfHeight);
delay(100);
DropChar(WhichCol,24-HalfHeight);
}
void DropChar(int Column,int FromWhere)
{
char C;
int I;
if (GetChar(Column,FromWhere)!=' ')
{
for(I=FromWhere;I<24;I++)
{
C = GetChar(Column,I);
PutChar(' ',Column,I);
PutChar(C,Column,I+1);
delay(25);
WasBlank = False;
}
MakeSound();
BounceChar(Column,FromWhere);
}
}
void RaiseChar(int Column,int ByHowMuch)
{
int I,RowPos = 24;
char C;
for(I=0;I<ByHowMuch;I++,RowPos--)
{
C = GetChar(Column,RowPos);
PutChar(' ',Column,RowPos);
PutChar(C,Column,RowPos-1);
delay(50);
}
}
void MakeSound()
{
sound(50);
delay(10);
nosound();
}
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.