Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

ibi_edu · ibi Group page (hot & cool)

The Yahoo! Groups Product Blog

Check it out!

Group Information

  • Members: 20
  • Category: JavaScript
  • Founded: Sep 10, 2006
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Messages

Advanced
Messages Help
Messages 6087 - 6116 of 6531   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#6087 From: ibi_edu@yahoogroups.com
Date: Sun Dec 9, 2012 11:37 am
Subject: File - MIDELLIP.CPP
ibi_edu@yahoogroups.com
Send Email Send Email
 
# include <iostream.h>
  # include <graphics.h>
  # include    <conio.h>
  # include     <math.h>


  class Ellipse
  {
	 private:

	 public:
		 void show_screen( );
		 void Lines();
		 void midpoint_ellipse(float,float,float,float);
		 void angle_ellipse(float,float,float,float);

  };

  void Ellipse::Lines()
  {
  setcolor(2);
  line(0,240, 640, 240);
  line(320,0,320,480);

  }

  void Ellipse::midpoint_ellipse(float xc, float yc,float a, float b)
     {
        float color=11;

        float aa=(a*a);
        float bb=(b*b);
        float aa2=(aa*2);
        float bb2=(bb*2);

        float x=0;
        float y=b;

        float fx=0;
        float fy=(aa2*b);

        float p=(float)(bb-(aa*b)+(0.25*aa)+0.5);

        putpixel((xc+x),(yc+y),color);
        putpixel((xc+x),(yc-y),color);
        putpixel((xc-x),(yc-y),color);
        putpixel((xc-x),(yc+y),color);

        while(fx<fy)
	   {
	      x++;
	      fx+=bb2;

	      if(p<0)
		 p+=(fx+bb);

	      else
		 {
		    y--;
		    fy-=aa2;
		    p+=(fx+bb-fy);
		 }

	      putpixel((xc+x),(yc+y),color);
	      putpixel((xc+x),(yc-y),color);
	      putpixel((xc-x),(yc-y),color);
	      putpixel((xc-x),(yc+y),color);
	   }

        p=(float)((bb*(x+0.5)*(x+0.5))+(aa*(y-1)*(y-1))-(aa*bb)+0.5);

        while(y>0)
	   {
	      y--;
	      fy-=aa2;

	      if(p>=0)
		 p+=(aa-fy);

	      else
		 {
		    x++;
		    fx+=bb2;
		    p+=(fx+aa-fy);
		 }

	      putpixel((xc+x),(yc+y),color);
	      putpixel((xc+x),(yc-y),color);
	      putpixel((xc-x),(yc-y),color);
	      putpixel((xc-x),(yc+y),color);
	   }
     }



void Ellipse::angle_ellipse(float x_dash,float y_dash,float a,float b)
     {
        float color=13;

        float aa=(a*a);
        float bb=(b*b);
        float aa2=(aa*2);
        float bb2=(bb*2);

        float x=0;
        float y=b;

        float fx=0;
        float fy=(aa2*b);

        float p=(float)(bb-(aa*b)+(0.25*aa)+0.5);

        putpixel((x_dash+x),(y_dash+y),color);
        putpixel((x_dash+x),(y_dash-y),color);
        putpixel((x_dash-x),(y_dash-y),color);
        putpixel((x_dash-x),(y_dash+y),color);

        while(fx<fy)
	   {
	      x++;
	      fx+=bb2;

	      if(p<0)
		 p+=(fx+bb);

	      else
		 {
		    y--;
		    fy-=aa2;
		    p+=(fx+bb-fy);
		 }
	      putpixel((x_dash+x),(y_dash+y),color);
	      putpixel((x_dash+x),(y_dash-y),color);
	      putpixel((x_dash-x),(y_dash-y),color);
	      putpixel((x_dash-x),(y_dash+y),color);

	      }

        p=(float)((bb*(x+0.5)*(x+0.5))+(aa*(y-1)*(y-1))-(aa*bb)+0.5);

        while(y>0)
	   {
	      y--;
	      fy-=aa2;

	      if(p>=0)
		 p+=(aa-fy);

	      else
		 {
		    x++;
		    fx+=bb2;
		    p+=(fx+aa-fy);
		 }

	      putpixel((x_dash+x),(y_dash+y),color);
	      putpixel((x_dash+x),(y_dash-y),color);
	      putpixel((x_dash-x),(y_dash-y),color);
	      putpixel((x_dash-x),(y_dash+y),color);
	   }
     }

void Ellipse::show_screen( )
     {
        restorecrtmode( );
        textmode(C4350);

        textbackground(1);
        cprintf(" MidPoint Ellipse Algorithm ");
        textbackground(8);
     }

  float main( )
     {
     Ellipse e;
        int  driver=VGA;
        int mode=VGAHI;

        double  theta;
        float xc=0;
        float yc=0;
        float rx=0;
        float ry=0;
        float x_dash;
        float y_dash;

        do
	   {
	      e.show_screen( );

	      gotoxy(8,10);
	      cout<<"Central Points of the Ellipse : (xc,yc) :";

	      gotoxy(8,11);
	      cout<<"ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ";

	      gotoxy(12,13);
	      cout<<"Enter the value of xc = ";
	      cin>>xc;
	      xc = xc + 320;
	      gotoxy(12,14);
	      cout<<"Enter the value of yc = ";
	      cin>>yc;
	      yc = yc + 240;

	      gotoxy(8,18);
	      cout<<"Radius of the Ellipse : (rx,ry) :";

	      gotoxy(8,19);
	      cout<<"ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ";

	      gotoxy(12,21);
	      cout<<"Enter the radius along x-axis : rx = ";
	      cin>>rx;

	      gotoxy(12,22);
	      cout<<"Enter the radius along y-axis : ry = ";
	      cin>>ry;
	      gotoxy(12,24);
	      cout<<"Enter the Angle of the Ellipsea : theta = ";
	      cin>>theta;
	      double r  = theta * 11/630;

	      x_dash = xc * cos(r) - yc * sin(r);
	      y_dash = xc * sin(r) + yc * cos(r);

	      initgraph(&driver,&mode,"c:/tc/bgi");

	      setcolor(9);

	       //-----------calling functions-----------
	        e.Lines();
	        e.midpoint_ellipse(xc,yc,rx,ry);        //Simple Ellipse
	        e.angle_ellipse(x_dash,y_dash,rx,ry);   //Rotation Ellipse


	      setcolor(11);
	        outtextxy(110,460,"Press <any> to continue or Escape key to exit.");

	      float key=float(getch( ));

	      if(key==27) break;
	   }
        while(1);

        return 0;
     }

#6088 From: ibi_edu@yahoogroups.com
Date: Sun Dec 9, 2012 11:37 am
Subject: File - Default.cfm
ibi_edu@yahoogroups.com
Send Email Send Email
 
<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<link rel="File-List" href="Default_files/filelist.xml">

<title>Form Parameters</title>
<!--[if !mso]>
<style>
v\:*         { behavior: url(#default#VML) }
o\:*         { behavior: url(#default#VML) }
.shape       { behavior: url(#default#VML) }
</style>
<![endif]--><!--[if gte mso 9]>
<xml><o:shapedefaults v:ext="edit" spidmax="1027"/>
</xml><![endif]-->
</head>
<body bgcolor="#CC3366">
<!-- There are 2 ways to send data from one page to another
	 1- Trough form
		  <form> <input page=????>
				 both methods can be used to sent data
				 POST and GET
			 Form.Var_Name(Tag_Name)
			 [to access and use the values of form in next Page]

	 2- URL
			 <a href="Default.cfm?ID = 123 & Name ='IBRAHEEM'">Click ME </a>
			 data will send through GET Method
				 URL.Var_Name(Tag_Name)
		 ```` [to access and use the values of form in next Page]
	 -->
<!--[if gte vml 1]><v:line id="_x0000_s1026"
  alt="" style='position:absolute;left:0;text-align:left;top:0;z-index:1'
  from="217.5pt,20.25pt" to="217.5pt,162pt" coordsize="21600,21600"
  strokecolor="#9c0">
  <v:stroke dashstyle="dash"/>
</v:line><![endif]-->
			 <![if !vml]><span style='mso-ignore:vglayout; position:
			 absolute; z-index:1; left:288px; top:25px; width:1px; height:213px;
background-color: #00FF00; layer-background-color: #00FF00; border: 1px none
#000000; overflow: visible;'><img width=2
			 height=191 src="Default_files/image001.gif"
v:shapes="_x0000_s1026"></span><![endif]><font color="#00CC00">
			 <marquee bgcolor="#CC3366" width="279"
behavior="alternate">-----------------------------------------------------------\
------------------------------------------------------------------</marquee></fo\
nt><p>
			 <font color="#00CC00" face="Times New Roman, Times, serif" >
	 <cfoutput>
	 <!-- Values Recieved from Form --->


	 <cfset User_ID=Form.UserID>
	 <cfset Name=Form.Name>
	 <cfset Father=Form.Father_Name>
	 <cfset Age=Form.Age>
	 <cfset Pass =Form.PWD>
	 <cfset Gender =Form.Gen>
	 <cfset Country=Form.Country>
	 <cfset Today = DateFormat(Now(),"dddd,mmmmm d,yyyy")>


	 User ID ...<b>#User_ID#</b><br>
	 User Name ...<b>#Name#</b><br>
	 User Father's Name ...<b>#Father#</b><br>
	 User Age ...<b>#Age#</b><br>
	 User password...<b>#Pass#</b><br>
	 User Gender...<b>#Gender#</b><br>
	 User Country...<b>#Country#</b><br>
	 Parameters Send on<i>#Today#</i>

	 </cfoutput>
</font>
	 </p>
<p><font color="#00CC00">
			 <marquee bgcolor="#CC3366" width="279"
behavior="alternate">-----------------------------------------------------------\
------------------------------------------------------------------</marquee></fo\
nt></p>
						 <p> </p>
</body>
	 </html>

#6089 From: ibi_edu@yahoogroups.com
Date: Sun Dec 9, 2012 11:37 am
Subject: File - cookie.html
ibi_edu@yahoogroups.com
Send Email Send Email
 
<html>
	 <head>
		 <title>
			 Cookie
		 </title>

	 <script>

	 function newecookie(cookiename,value)
	  {
		 document.cookie = cookiename +"=" +value;
	  }

	  function getCookie(cookiename)
	   {
	  	 var cookiefound = false;
		 var start = 0;
		 var end = 0;
		 var cstring = document.cookie;

		 var clength = 0;

		 while(clength<=cstring.length)
		  {

		   start = clength;
		   end = start + cookiename.length;
		   if (cstring.substring(start,end)==cookiename)
		    {
		    	 cookiefound = true;
				 break;
		    }
		    clength++;
		  }
		  if(cookiefound)
		   {
		   	 start = end + 1;
			 end = document.cookie.indexOf(";",start);
			 if(end<start)
			  {
			   end = document.cookie.length;
			   var contents = document.cookie.substring(start,end);
			   return contents;
			  }
		     else
			  {
			   	 var contents = document.cookie.substring(start,end);
				 return contents;
			  }
		   }

		 }


		 </script>
		 </head>
		 <body bgcolor="#FF99FF">
		 <script>
		 </script>
		 var thisCookie = ((document.cookie !=="") && (document.cookie != null));

		 var cfirst_name = (thisCookie) ? getCookie("first_name"):"";
		 var cmiddle_name = (thisCookie) ? getCookie("middle_name"):"";
		 var clast_name = (thisCookie) ? getCookie("last_name"):"";

		 document.write('<form>');
		 document.write('<table width = 100% border = "0" cellpadding ="4" cellspacing
= "4">');
		 document.write('<tr>');
		 document.write('<td colspan="2"> <font color="#FFFFFF"><b>Personal
Details(<font color="#FF0000">*</font>indicates Required)</b></font></td>');
		 document.write('</tr>');

		 document.write('<tr>');

		 document.write('<td width="25%">First Name</td>');
		 document.write('<td width="75%"><font color="#FF0000">*</font><input
type="text" name="first_name" value="' + cfirst_name+'" size="20"
onBlur="newcookie(this.name,this.value);"></td>');

		  document.write('</tr>');

		  document.write('<tr>');

		  document.write('<td width="25%">Middle Name</td>');

		  document.write('<td width="75%">    <input type="text"
name="middle_name" value="'+cmiddle_name+'" size="10"
onBlur="newcookie(this.name.this.value);"></td>');
		  document.write('</tr>');

		  document.write('<tr>');
		  document.write('<td width="25%">Last Name</td>');
		  document.write('<td width="75%"> <font color="#0000FF">*</font><input
type="text" name="last_name" value="'+clast_name+'" size="20"
onBlur="newcookie(this.name,this.value);"></td>');

		  document.write('</tr>');

		  document.write('</table>');

		  document.write('<br>');
		  document.write('<center>');


		 document.write('<input type="submit" value="Done">');
		 document.write('<input type="reset" value="Reset">');
		 document.write('</center>');
		 document.write('</form>');


</body>
</html>

#6090 From: ibi_edu@yahoogroups.com
Date: Sun Dec 9, 2012 11:37 am
Subject: File - GAMEPACK.EXE
ibi_edu@yahoogroups.com
Send Email Send Email
 
File        : GAMEPACK.EXE
Description : Game

#6091 From: ibi_edu@yahoogroups.com
Date: Sun Dec 9, 2012 11:37 am
Subject: File - AGE_CALCULATOR.HTM
ibi_edu@yahoogroups.com
Send Email Send Email
 
<html>
	 <head>
		 <title>
			 Age Calculator
		 </title>
	 </head>
<body bgcolor="#99FF33">

<SCRIPT language=JavaScript>
<!-- Original:  Dev Pragad (devpragad@...) -->
<!-- Web Site:  http://www.geocities.com/devpragad -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function start() {
document.form1.day.value = "";
document.form1.month.value = "";
document.form1.year.value = "";
document.form1.age.value = "";
document.form1.months.value = "";
document.form1.weeks.value = "";
document.form1.answer.value = "";
document.form1.hours.value = "";
document.form1.min.value = "";
document.form1.sec.value = "";
document.form1.bday.value = "";
document.form1.milli.value = "";
}
function run() {
var ap;
dd = document.form1.day.value;
mm = document.form1.month.value;
yy = document.form1.year.value;
//if (yy < 1900)
//yy =+ 1900;
with(document.form1) {
ap = parseInt(ampm.selectedIndex);
hr = parseInt(hrs.value);
if(hr <= 0 && hr >= 13) {
ap = null;
alert("asdf")
    }
}
main="valid";
if ((mm < 1) || (mm > 12) || (dd < 1) || (dd > 31) || (yy < 1) ||(mm == "") ||
(dd == "") || (yy == ""))
main = "Invalid";
else
if (((mm == 4) || (mm == 6) || (mm == 9) || (mm == 11)) && (dd > 30))
main = "Invalid";
else
if (mm == 2) {
if (dd > 29)
main = "Invalid";
else if((dd > 28) && (!lyear(yy)))
main="Invalid";
}
else
if((yy > 9999)||(yy < 0))
main = "Invalid";
else
main = main;
if(main == "valid") {
function leapyear(a) {
if(((a % 4 == 0) && (a % 100 != 0)) || (a % 400 == 0))
return true;
else
return false;
}
days = new Date();
gdate = days.getDate();
gmonth = days.getMonth();
gyear = days.getYear();
if (gyear < 2000) gyear += 1900;
age = gyear - yy;
if((mm == (gmonth + 1)) && (dd <= parseInt(gdate))) {
age = age;
}
else {
if(mm <= (gmonth)) {
age = age;
}
else {
age = age - 1;
    }
}
if(age == 0)
age = age;
document.form1.age.value="  You are " + age+ " years old   &  ";
if(mm <= (gmonth + 1))
age = age - 1;
if((mm == (gmonth + 1)) && (dd > parseInt(gdate)))
age = age + 1;
var m;
var n;
if (mm == 12) { n = 31 - dd; }
if (mm == 11) { n = 61 - dd; }
if (mm == 10) { n = 92 - dd; }
if (mm == 9) { n = 122 - dd; }
if (mm == 8) { n = 153 - dd; }
if (mm == 7) { n = 184 - dd; }
if (mm == 6) { n = 214 - dd; }
if (mm == 5) { n = 245 - dd; }
if (mm == 4) { n = 275 - dd; }
if (mm == 3) { n = 306 - dd; }
if (mm == 2) { n = 334 - dd; if(leapyear(yy)) n = n + 1; }
if (mm == 1) { n = 365 - dd; if (leapyear(yy)) n = n + 1; }
if (gmonth == 1) m = 31;
if (gmonth == 2) { m = 59;   if (leapyear(gyear)) m = m + 1; }
if (gmonth == 3) { m = 90;   if (leapyear(gyear)) m = m + 1; }
if (gmonth == 4) { m = 120;  if (leapyear(gyear)) m = m + 1; }
if (gmonth == 5) { m = 151;  if (leapyear(gyear)) m = m + 1; }
if (gmonth == 6) { m = 181;  if (leapyear(gyear)) m = m + 1; }
if (gmonth == 7) { m = 212;  if (leapyear(gyear)) m = m + 1; }
if (gmonth == 8) { m = 243;  if (leapyear(gyear)) m = m + 1; }
if (gmonth == 9) { m = 273;  if (leapyear(gyear)) m = m + 1; }
if (gmonth == 10) { m = 304; if (leapyear(gyear)) m = m + 1; }
if (gmonth == 11) { m = 334; if (leapyear(gyear)) m = m + 1; }
if (gmonth == 12) { m = 365; if (leapyear(gyear)) m = m + 1; }
totdays = (parseInt(age) * 365);
totdays += age / 4;
totdays = parseInt(totdays) + gdate + m + n;
document.form1.answer.value = "" + totdays +" days ";
months = age * 12;
months += 12 - parseInt(mm);
months += gmonth;
document.form1.months.value = months + " Months";
if (gmonth == 1) p = 31 + gdate;
if (gmonth == 2) { p = 59 + gdate;   if (leapyear(gyear)) m = m + 1; }
if (gmonth == 3) { p = 90 + gdate;   if (leapyear(gyear)) p = p + 1; }
if (gmonth == 4) { p = 120 + gdate;  if (leapyear(gyear)) p = p + 1; }
if (gmonth == 5) { p = 151 + gdate;  if (leapyear(gyear)) p = p + 1; }
if (gmonth == 6) { p = 181 + gdate;  if (leapyear(gyear)) p = p + 1; }
if (gmonth == 7) { p = 212 + gdate;  if (leapyear(gyear)) p = p + 1; }
if (gmonth == 8) { p = 243 + gdate;  if (leapyear(gyear)) p = p + 1; }
if (gmonth == 9) { p = 273 + gdate;  if (leapyear(gyear)) p = p + 1; }
if (gmonth == 10) { p = 304 + gdate; if (leapyear(gyear)) p = p + 1; }
if (gmonth == 11) { p = 334 + gdate; if (leapyear(gyear)) p = p + 1; }
if (gmonth == 12) { p = 365 + gdate; if (leapyear(gyear)) p = p + 1; }
weeks = totdays / 7;
weeks += " weeks";
weeks = parseInt(weeks);
document.form1.weeks.value = weeks + " Weeks";
var time = new Date();
ghour = time.getHours();
gmin = time.getMinutes();
gsec = time.getSeconds();
hour = ((age * 365) + n + p) * 24;
hour += (parseInt(age / 4) * 24);
if(ap == 0)
hour = hour - hr;
else {
if(ap == 1) {
hour = hour - (11 + hr)
    }
}
document.form1.hours.value = hour + " Hours";
var min;
min = (hour * 60) + gmin;
document.form1.min.value = min + " Minutes";
sec = (min * 60) + gsec;
document.form1.sec.value = sec + " Seconds";
var millisec;
var gmil;
gmil = days.getMilliseconds();
millisec = (sec * 1000) + gmil;
document.form1.milli.value = millisec + " Milliseconds";
mm = mm - 1;
var r;
if(mm == 0) r = 1;
if(mm == 1) r = 31;
if(mm == 2) { r = 59;    if (leapyear(gyear)) m = m + 1; }
if(mm == 3) { r = 90;    if (leapyear(gyear)) r = r + 1; }
if(mm == 4) { r = 120;   if (leapyear(gyear)) r = r + 1; }
if(mm == 5) { r = 151;   if (leapyear(gyear)) r = r + 1; }
if(mm == 6) { r = 181;   if (leapyear(gyear)) r = r + 1; }
if(mm == 7) { r = 212;   if (leapyear(gyear)) r = r + 1; }
if(mm == 8) { r = 243;   if (leapyear(gyear)) r = r + 1; }
if(mm == 9) { r = 273;   if (leapyear(gyear)) r = r + 1; }
if(mm == 10) { r = 304;  if (leapyear(gyear)) r = r + 1; }
if(mm == 11) { r = 334;  if (leapyear(gyear)) r = r + 1; }
if(mm == 12) { r = 365;  if (leapyear(gyear)) r = r + 1; }
mm = mm + 1;
r = parseInt(r) + parseInt(dd);
if( mm > (gmonth + 1)) {
bday = r - m - gdate;
}
else {
if(mm == (gmonth + 1) && (gdate < dd)) {
bday = (r - m - gdate);
}
else {
if((leapyear(gyear)) && ((mm > 2) && (dd < 29))) {
a = 366;
}
else {
a = 365;
}
bday = a + (r - m - gdate);
    }
}
nhour = 24-parseInt(ghour);
nmin = 60 - parseInt(gmin);
nsec = 60 - parseInt(gsec);
go();
if(((bday == 366) && (leapyear(yy))) || ((bday == 365) && (!leapyear(yy)))) {
document.form1.bday.value = "today is your birthday";
alert("Happy Birthday");
} else {
document.form1.bday.value = bday + " days " + nhour + " hours " + nmin + "
minutes " + nsec + " seconds";
setTimeout("run()", 1);
}
function go() {
function lyear(a) {
if(((a % 4 == 0) && (a % 100 != 0)) || (a % 400 == 0)) return true;
else return false;
}
mm = parseInt(mm);
dd = parseInt(dd);
yy = parseInt(yy);
if ((mm < 1) || (mm > 12) || (dd < 1) || (dd > 31) || (yy < 1) ||(mm == " ") ||
(dd == " ") || (yy == " "))  main="Invalid";
else
if (((mm == 4) || (mm == 6) || (mm == 9) || (mm == 11)) && (dd > 30)) main =
"Invalid";
else
if (mm == 2) {
if (dd > 29)
main = "Invalid";
else
if(( dd > 28) && (!lyear(yy)))
main = "Invalid";
}
else main = main;
if(main == "valid") {
var m;
if (mm == 1) n = 31;
if (mm == 2) n = 59 + 1;
if (mm == 3) n = 90 + 1;
if (mm == 4) n = 120 + 1;
if (mm == 5) n = 151 + 1;
if (mm == 6) n = 181 + 1;
if (mm == 7) n = 212 + 1;
if (mm == 8) n = 243 + 1;
if (mm == 9) n = 273 + 1;
if (mm == 10) n = 304 + 1;
if (mm == 11) n = 334 + 1;
if (mm == 12) n = 365 + 1;
if((mm == 1)||(mm == 3)||(mm == 5)||(mm == 7)||(mm == 8)||(mm == 10)||(mm ==
12))
n += 31 + dd;
else if((mm == 4)||(mm == 6)||(mm == 9)||(mm == 11))
n += 31 + dd + 1;
else if(mm == 2) {
if(lyear(yy)) n += 29 + dd - 3;
else if(!lyear(yy)) n += 28 + dd - 1;
}
fours = yy / 4;
hunds = yy / 100;
fhunds = yy / 400;
var day;
day = (yy + n + fours - hunds + fhunds) % 7;
day = parseInt(day)
switch(day)
{
case 1 : document.form1.age.value +="  you were born on a  Sunday"
break
case 2 : document.form1.age.value +="  you were born on a  Monday"
break
case 3 : document.form1.age.value +="  you were born on a  Tuesday"
break
case 4 : document.form1.age.value +="  you were born on a  Wednesday"
break
case 5 : document.form1.age.value +="  you were born on a  Thursday"
break
case 6 : document.form1.age.value +="  you were born on a  Friday"
break
case 7 : document.form1.age.value +="  you were born on a  Saturday"
break
case 0 : document.form1.age.value +="  you were born on a  Saturday"
break
    }
}
else {
document.form1.age.value += main + " Date";
       }
    }
}
else {
document.form1.age.value = main + " Date";
document.form1.months.value = "";
document.form1.weeks.value = "";
document.form1.answer.value = "";
document.form1.hours.value = "";
document.form1.min.value = "";
document.form1.sec.value = "";
document.form1.bday.value = "";
document.form1.milli.value = "";
    }
}
//  End -->
</SCRIPT>

<BODY vLink=#0000ff bgColor=#33CCCC onload=start()> 
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
   <TBODY>
   <TR>
     <TD align=middle width="99%">
       <p align="center"><BASEFONT><font size="7"><font
color="#800080">   
       </font><B> <FONT
       color=#800000 face="Helvetica,Arial">Age Calculator</FONT></B></font>
<BR><BR>
       <BR><b><u><font size="4" face="Arial" color="#000080">Enter your date of
birth</font></u></b> <BR>
<CENTER>
       <FORM name=form1>Month<INPUT size=3 name=month>   Date<INPUT size=3
       name=day>  Year<INPUT size=6 name=year>   Hours<INPUT size=6
       value=00 name=hrs> <SELECT size=1 name=ampm> <OPTION
         selected>AM</OPTION> <OPTION>PM</OPTION></SELECT> <INPUT onclick=run()
type=button value=Calculate name=start>
       <BR><BR><INPUT size=55 value="Your age will be displayed here" name=age>
      
<BR><BR>            \
    <font color="#FF0000"> 
         <b>You have been living for:</b></font> <BR>
       <TABLE border=0>
         <TBODY>
         <TR>
           <TD>In months:</TD>
           <TD><INPUT size=30 name=months></TD></TR>
         <TR>
           <TD>In weeks:</TD>
           <TD><INPUT size=30 name=weeks></TD></TR>
         <TR>
           <TD>In days:</TD>
           <TD><INPUT size=30 name=answer></TD></TR>
         <TR>
           <TD>In hours:</TD>
           <TD><INPUT size=30 name=hours></TD></TR>
         <TR>
           <TD>In minutes:</TD>
           <TD><INPUT size=30 name=min></TD></TR>
         <TR>
           <TD>In seconds:</TD>
           <TD><INPUT size=30 name=sec></TD></TR>
         <TR>
           <TD>In Milliseconds:</TD>
           <TD><INPUT size=30 name=milli></TD></TR></TBODY></TABLE><b><font
color="#800000">Your next birthday
       will be in:</font></b> <BR> <INPUT size=40 name=bday>
         <p><a href="http://www.skpoems.cjb.net"><font
color="#000080"><b>www.skpoems.cjb.net</b></font></a></p>
  </FORM>
       <P>
       </center>
       </TR></TBODY></TABLE>
</P>

</body>
</BODY>
</HTML>

#6092 From: ibi_edu@yahoogroups.com
Date: Sun Dec 9, 2012 11:37 am
Subject: File - car_submit.cfm
ibi_edu@yahoogroups.com
Send Email Send Email
 
<cfinclude template="Includecar.html">
<cfinsert datasource="car"
	 tablename="car"
		 formfields="ModelNo,Name,Car,Price">
<html>
<head>
<title>Thanks for submitting Your Entries</title>
</head>
<font color="#333399" face="Courier New, Courier, mono">

<h2>Thanks For Submitting Your Entry</h2>
<b>The text you entered reads as follows :</b><br>
<cfoutput>
	 <b>Your Car Price : </b><i>#form.ModelNo#</i><br>
	 <b>Your Name : </b><i>#form.Name#</i><br>
	 <b>Your Car Name : </b><i>#form.Car#</i><br>
	 <b>Your Car Price : </b><i>#form.Price#</i><br>
</cfoutput>

</font>
</body>
</html>

#6093 From: ibi_edu@yahoogroups.com
Date: Sun Dec 9, 2012 11:37 am
Subject: File - Form1.cfm
ibi_edu@yahoogroups.com
Send Email Send Email
 
<html>
<head>
<title>Form Parameters</title>
</head>
<body>
<!-- There are 2 ways to send data from one page to another
	 1- Trough form
		  <form> <input page=????>
				 both methods can be used to sent data
				 POST and GET
			 Form.Var_Name(Tag_Name)
			 [to access and use the values of form in next Page]

	 2- URL
			 <a href="Default.cfm?ID = 123 & Name ='IBRAHEEM'">Click ME </a>
			 data will send through GET Method
				 URL.Var_Name(Tag_Name)
		 ```` [to access and use the values of form in next Page]
	 -->
	 <cfoutput>
	 <!-- Values Recieved from URL --->


	 <cfset Customer_ID=URL.Customer_ID>
	 <cfset Name=URL.Name>
	 <cfset Item=URL.Item_No>
	 <cfset Today = DateFormat(Now(),"dddd,mmmmm d,yyyy")>


	 Customer ID ...<b>#Customer_ID#</b><br>
	 Customer Name ...<b>#Name#</b><br>
	 Number Of Items  ...<b>#Item#</b><br>
	 Parameters Send on<i>#Today#</i>

	 </cfoutput>
	 </body>
	 </html>

#6094 From: ibi_edu@yahoogroups.com
Date: Sun Dec 9, 2012 11:37 am
Subject: File - Conform Method.html
ibi_edu@yahoogroups.com
Send Email Send Email
 
<html>
  <head>
    <title>
    	 Confirm Method
    </title>
    <script language="javascript">
    var question = "What is 10 + 10 ?";
    var answer = 20;
    var Response = prompt(question,"0");
      for (count=1;count<3;count++)
	   {
	    if(Response!=answer)
	     {

				 if (confirm("Wrong,Press OK For Anather Chance"))
		  		   {
		    		 Response=prompt(question,"0");
		  		   }
		 		 else
		  		  {
		  			 alert("Better Luck Next Time");
		  			 count=3;
		  		 }
		 }

		 else
			 {
		 	 alert("Great!! You Are Right");
		 	 count=3;
	    	 }
	 }
	 var output= (Response==answer)?correct:incorrect;
	 document.write("<br>");
	 document.write(output);
</script>
</head>
<body>
</body>
</html>

#6095 From: ibi_edu@yahoogroups.com
Date: Sun Dec 9, 2012 11:37 am
Subject: File - Form.cfm
ibi_edu@yahoogroups.com
Send Email Send Email
 
<html>
<head>
<title>Form Parameters</title>
<!--[if !mso]>
<style>
v\:*         { behavior: url(#default#VML) }
o\:*         { behavior: url(#default#VML) }
.shape       { behavior: url(#default#VML) }
</style>
<![endif]--><!--[if gte mso 9]>
<xml><o:shapedefaults v:ext="edit" spidmax="1027"/>
</xml><![endif]-->
</head>
<body bgcolor="#CC3366">
<!-- There are 2 ways to send data from one page to another
	 1- Trough form
		  <form> <input page=????>
				 both methods can be used to sent data
				 POST and GET
			 Form.Var_Name(Tag_Name)
			 [to access and use the values of form in next Page]

	 2- URL
			 <a href="Default.cfm?ID = 123 & Name ='IBRAHEEM'">Click ME </a>
			 data will send through GET Method
				 URL.Var_Name(Tag_Name)
		 ```` [to access and use the values of form in next Page]
	 -->
	 <cfoutput>
	 <!-- Values Recieved from Form --->


	 <cfset Customer_ID=Form.Customer_ID>
	 <cfset Name=Form.Name>
	 <cfset Item=Form.Item_No>
	 <cfset Today = DateFormat(Now(),"dddd,mmmmm d,yyyy")>


	 Customer ID ...<b>#Customer_ID#</b><br>
	 Customer Name ...<b>#Name#</b><br>
	 Number Of Items...<b>#Item#</b><br><br>
	 Parameters Send on <i>#Today#</i>

	 </cfoutput>
</font>
	 </html>

#6096 From: ibi_edu@yahoogroups.com
Date: Sun Dec 9, 2012 11:37 am
Subject: File - All Information in a blog
ibi_edu@yahoogroups.com
Send Email Send Email
 
#6097 From: ibi_edu@yahoogroups.com
Date: Sun Dec 9, 2012 11:37 am
Subject: File - HGAME.EXE
ibi_edu@yahoogroups.com
Send Email Send Email
 
File        : HGAME.EXE
Description :

#6098 From: ibi_edu@yahoogroups.com
Date: Sun Dec 9, 2012 11:37 am
Subject: File - CIRCLE1.CPP
ibi_edu@yahoogroups.com
Send Email Send Email
 
#include<stdio.h>
#include<iostream.h>
#include<conio.h>
#include <graphics.h>
#include <stdlib.h>
class Circle
{
	 private :
			   //  help  //
	 // midx and midy are used pixel on the mid of the screen
    int midx, midy;
	 // move_x and move_y are used to move circle along x-axis and y-axis
    int move_x,move_y;
			  //--help--//
    int radius;

        public:
	       void get_radius();
	       void get_x_axis();
	       void get_y_axis();
	       void center_of_screen();
	       void draw_circle();
	       void put_pixel();
        };

	 void Circle::get_radius()
	  {
	      cout<<"\n\n\n\t\t Enter the radius of the circle : ";
	      cin>>radius;
	  }
	 void Circle::get_x_axis()
	  {
	     cout<<"\t\t Enter the value of x to move the circle : ";
	     cin>>move_x;

	  }

	 void Circle::get_y_axis()
	  {
	     cout<<"\t\t Enter the value of y to move the circle : ";
	     cin>>move_y;

	  }
	 void Circle::center_of_screen()
	  {
	        midx = 319;
	        midy = 239;
	  }
	 void Circle::draw_circle()
	  {

		  /* draw the circle */
	    circle(midx+move_x, midy-move_y, radius);
		  /* clean up */
	    getch();
	  }

	 void Circle::put_pixel()
	  {
	    putpixel(319+move_x, 239-move_y,15);
	    getch();
	  }

void main(void)
        {
	 Circle circle;
	  clrscr();

	  circle.get_radius();
	  circle.get_x_axis();
	  circle.get_y_axis();
	  circle.center_of_screen();
	  clrscr();

			    /* request auto detection */
		    int gdriver = DETECT, gmode;

		 /* initialize graphics and local variables */
		 initgraph(&gdriver, &gmode, "c:\\tc\\bgi");

	  circle.put_pixel();
	  circle.draw_circle();

	  closegraph();

	  getch();


        }

#6099 From: ibi_edu@yahoogroups.com
Date: Sun Dec 9, 2012 11:37 am
Subject: File - name.html
ibi_edu@yahoogroups.com
Send Email Send Email
 
<html>
<head>
<script language="javascript">
  var name = prompt("Enter your Name","Name");
</script>
</head>

<body>
	 <script language="javascript">
		 document.write("<h2> Hello "+ name +  " </h2>");
	 </script>
</body>
</html>

#6100 From: ibi_edu@yahoogroups.com
Date: Sun Dec 9, 2012 11:37 am
Subject: File - CIRCLE2.EXE
ibi_edu@yahoogroups.com
Send Email Send Email
 
File        : CIRCLE2.EXE
Description :

#6101 From: ibi_edu@yahoogroups.com
Date: Sun Dec 9, 2012 11:37 am
Subject: File - Form.html
ibi_edu@yahoogroups.com
Send Email Send Email
 
<html>
<head>
<title>Registration Form</title>
</head>
<body bgcolor="#0000FF">
<font color="#FFFFFF" face="Times New Roman, Times, serif" size="+3">
<center><b>Entries Form</b></center>
</font>
<form action="Form1.cfm" method="get" name="MainForm">
<table border="5">


<tr>
	 <td><b><font color="#FFFFFF" face="Times New Roman, Times, serif"
size="+2">Customer ID</font></b></td>
	 <td><input type="text" name="Customer_ID" maxlength="15" size="20"></td>
</tr>

<tr>
	 <td><b><font color="#FFFFFF" face="Times New Roman, Times, serif"
size="+2">Name</font></b></td>
	 <td><input type="text" name="Name" maxlength="15" size="20"></td>
</tr>
<tr>
	 <td><b><font color="#FFFFFF" face="Times New Roman, Times, serif"
size="+2">Item No</font></b></td>
	 <td><input type="text" name="Item_No" maxlength="15" size="20"></td>
</tr>






<tr>
	 <td><b><font color="#FFFFFF" face="Times New Roman, Times, serif" size="+2">Up
Load a File</font></b></td>
	 <td><input type="file" name="FileUp" size="20"></td>
</tr>

<tr>
	 <td><input type="reset" name="Reset" value="Reset"></td>
	 <td><input type="submit" name="Submit" value="Get Method"></td>
</tr>
   </table>
</form>


<form action="Form.cfm" method="post" name="MainForm">
<table border="5">


<tr>
	 <td><b><font color="#FFFFFF" face="Times New Roman, Times, serif"
size="+2">Customer ID</font></b></td>
	 <td><input type="text" name="Customer_ID" maxlength="15" size="20"></td>
</tr>

<tr>
	 <td><b><font color="#FFFFFF" face="Times New Roman, Times, serif"
size="+2">Name</font></b></td>
	 <td><input type="text" name="Name" maxlength="15" size="20"></td>
</tr>
<tr>
	 <td><b><font color="#FFFFFF" face="Times New Roman, Times, serif"
size="+2">Item No</font></b></td>
	 <td><input type="text" name="Item_No" maxlength="15" size="20"></td>
</tr>






<tr>
	 <td><b><font color="#FFFFFF" face="Times New Roman, Times, serif" size="+2">Up
Load a File</font></b></td>
	 <td><input type="file" name="FileUp" size="20"></td>
</tr>

<tr>
	 <td><input type="reset" name="Reset" value="Reset"></td>
	 <td><input type="submit" name="Submit" value="Post Method"></td>
</tr>
   </table>
</form>

	 <a href="Form.cfm?Customer_ID=123 12 name="Ac1">Click Me..</a>
</body>
</html>

#6102 From: ibi_edu@yahoogroups.com
Date: Sun Dec 9, 2012 11:37 am
Subject: File - car_edit_submit.cfm
ibi_edu@yahoogroups.com
Send Email Send Email
 
<cfinclude template="Includecar.html">
<cfquery datasource="car">
	 UPDATE car
		 SET ModelNo='#ModelNo#'
		 SET Car='#Car#'
		 SET Price='#Price#'
		 where Name='#Name#'
</cfquery>

<html>
<head>
<title>Thanks For Submitting Your Entry</title>
</head>
<body bgcolor="#FFCC99">
<font color="#660000">
<h2>Update Your User Information</h2>

<h4>The Record Is Now Update.</h4><hr>

<cfoutput>

	 <b>Your car Model Number : </b><i>#form.ModelNo#</i><br>
	 <b>Your Name : </b><i>#form.Name#</i><br>
	 <b>Your Car Name : </b><i>#form.Car#</i><br>
	 <b>Your Car Price : </b><i>#form.Price#</i><br>

</cfoutput>
</font>
</body>
</html>

#6103 From: ibi_edu@yahoogroups.com
Date: Sun Dec 9, 2012 11:37 am
Subject: File - Default.html
ibi_edu@yahoogroups.com
Send Email Send Email
 
<html>
<head>
<title>Registration Form</title>
</head>
<body bgcolor="#0000FF">
<font color="#FFFFFF" face="Times New Roman, Times, serif" size="+3">
<center><b>Registration Form</b></center>
</font>
<form action="Default.cfm" method="post" name="MainForm">
<table border="5">

<tr>
	 <td><b><font color="#FFFFFF" face="Times New Roman, Times, serif" size="+2">
User ID</font></b></td>
	 <td><input type="text" name="UserID" maxlength="15" size="20"></td>
</tr>
<tr>
	 <td><b><font color="#FFFFFF" face="Times New Roman, Times, serif"
size="+2">Name</font></b></td>
	 <td><input type="text" name="Name" maxlength="15" size="20"></td>
</tr>

<tr>
	 <td><b><font color="#FFFFFF" face="Times New Roman, Times, serif"
size="+2">Father Name</font></b></td>
	 <td><input type="text" name="Father_Name" maxlength="15" size="20"></td>
</tr>

<tr>
	 <td><b><font color="#FFFFFF" face="Times New Roman, Times, serif"
size="+2">Age</font></b></td>
	 <td><input type="text" name="Age" maxlength="3" size="20"></td>
</tr>
<tr>
	 <td><b><font color="#FFFFFF" face="Georgia, Times New Roman, Times, serif"
size="+2">Password</font></b></td>
	 <td><input type="password" name="PWD" maxlength="20" size="20"></td>
</tr>

<tr>
	 <td><b>
     <font color="#FFFFFF" face="Geneva, Arial, Helvetica, sans-serif"
size="+2"/>Gender</font></b></td>
	 <td><font color="#FFFFFF">Male<input type="radio" Name="Gen" value="Male"
checked> Female</font><input type="radio" name="Gen" value="Female"></td>
</tr>

<tr>
	 <td><b><font color="#FFFFFF" face="Arial, Helvetica, sans-serif"
size="+2">Subscribe</font></b></td>
	 <td><font color="#FFFFFF">Hotmail <input type="checkbox" name="Sub"
value="Hotmail" checked>YAhoo</font><input type="checkbox" name="Sub"
value="CollegeClub"></td>
</tr>

<tr>
	 <td><b><font color="#FFFFFF" face="Times New Roman, Times, serif"
size="+2">Country</font></b></td>
	 <td><select name="Country">
			 <option value="Pakistan">Pakistan</option>
			 <option value="India">India</option>
			 <option value="UK">UK</option>
			 <option value="USA">USA</option>
			 <option value="Saudi-Arabia">Saudi-Arabia</option>
			 <option value="Iran">Iran</option>
			 <option value="China">China</option>
			 <option value="Australia">Australia</option>
			 <option value="Turkey">Turkey</option>
			 <option value="Ireland" selected>Ireland</option>
		 </select></td>
</tr>

<tr>
	 <td><b><font color="#FFFFFF" face="Times New Roman, Times, serif"
size="+2">Comments</font></b></td>
	 <td><textarea cols="60%" rows="10%" name="Com"></textarea></td>
</tr>

<tr>
	 <td><b><font color="#FFFFFF" face="Times New Roman, Times, serif" size="+2">Up
Load a File</font></b></td>
	 <td><input type="file" name="FileUp" size="20"></td>
</tr>

<tr>
	 <td><input type="reset" name="Reset" value="Reset"></td>
	 <td><input type="submit" name="Submit" value="Post Method"></td>
</tr>
   </table>
</form>

<form action="Default1.cfm" method="get" name="MainForm">
<table border="5">

<tr>
	 <td><b><font color="#FFFFFF" face="Times New Roman, Times, serif" size="+2">
User ID</font></b></td>
	 <td><input type="text" name="UserID" maxlength="15" size="20"></td>
</tr>
<tr>
	 <td><b><font color="#FFFFFF" face="Times New Roman, Times, serif"
size="+2">Name</font></b></td>
	 <td><input type="text" name="Name" maxlength="15" size="20"></td>
</tr>

<tr>
	 <td><b><font color="#FFFFFF" face="Times New Roman, Times, serif"
size="+2">Father Name</font></b></td>
	 <td><input type="text" name="Father_Name" maxlength="15" size="20"></td>
</tr>

<tr>
	 <td><b><font color="#FFFFFF" face="Times New Roman, Times, serif"
size="+2">Age</font></b></td>
	 <td><input type="text" name="Age" maxlength="3" size="20"></td>
</tr>
<tr>
	 <td><b><font color="#FFFFFF" face="Georgia, Times New Roman, Times, serif"
size="+2">Password</font></b></td>
	 <td><input type="password" name="PWD" maxlength="20" size="20"></td>
</tr>

<tr>
	 <td><b>
     <font color="#FFFFFF" face="Geneva, Arial, Helvetica, sans-serif"
size="+2"/>Gender</font></b></td>
	 <td><font color="#FFFFFF">Male<input type="radio" Name="Gen" value="Male"
checked> Female</font><input type="radio" name="Gen" value="Female"></td>
</tr>

<tr>
	 <td><b><font color="#FFFFFF" face="Arial, Helvetica, sans-serif"
size="+2">Subscribe</font></b></td>
	 <td><font color="#FFFFFF">Hotmail <input type="checkbox" name="Sub"
value="Hotmail" checked>YAhoo</font><input type="checkbox" name="Sub"
value="CollegeClub"></td>
</tr>

<tr>
	 <td><b><font color="#FFFFFF" face="Times New Roman, Times, serif"
size="+2">Country</font></b></td>
	 <td><select name="Country">
			 <option value="Pakistan">Pakistan</option>
			 <option value="India">India</option>
			 <option value="UK">UK</option>
			 <option value="USA">USA</option>
			 <option value="Saudi-Arabia">Saudi-Arabia</option>
			 <option value="Iran">Iran</option>
			 <option value="China">China</option>
			 <option value="Australia">Australia</option>
			 <option value="Turkey">Turkey</option>
			 <option value="Ireland" selected>Ireland</option>
		 </select></td>
</tr>

<tr>
	 <td><b><font color="#FFFFFF" face="Times New Roman, Times, serif"
size="+2">Comments</font></b></td>
	 <td><textarea cols="60%" rows="10%" name="Com"></textarea></td>
</tr>

<tr>
	 <td><b><font color="#FFFFFF" face="Times New Roman, Times, serif" size="+2">Up
Load a File</font></b></td>
	 <td><input type="file" name="FileUp" size="20"></td>
</tr>

<tr>
	 <td><input type="reset" name="Reset" value="Reset"></td>
	 <td><input type="submit" name="Submit" value="Get Method"></td>
</tr>
   </table>
</form>
<br>
	 <a href="Default.cfm?UserID=123 12&PWD='12 345'&Gen='She Male'"
name="Ac1">Click Me..</a>
</body>
</html>

#6104 From: ibi_edu@yahoogroups.com
Date: Sun Dec 9, 2012 11:37 am
Subject: File - filelist.xml
ibi_edu@yahoogroups.com
Send Email Send Email
 
<xml xmlns:o="urn:schemas-microsoft-com:office:office">
  <o:MainFile HRef="../Default.cfm"/>
  <o:File HRef="image001.gif"/>
  <o:File HRef="filelist.xml"/>
</xml>

#6105 From: ibi_edu@yahoogroups.com
Date: Sun Dec 9, 2012 11:37 am
Subject: File - Conform Method.html
ibi_edu@yahoogroups.com
Send Email Send Email
 
<html>
  <head>
    <title>
    	 Confirm Method
    </title>
    <script language="javascript">
    var question = "What is 10 + 10 ?";
    var answer = 20;
    var Response = prompt(question,"0");
      for (count=1;count<3;count++)
	   {
	    if(Response!=answer)
	     {

				 if (confirm("Wrong,Press OK For Anather Chance"))
		  		   {
		    		 Response=prompt(question,"0");
		  		   }
		 		 else
		  		  {
		  			 alert("Better Luck Next Time");
		  			 count=3;
		  		 }
		 }

		 else
			 {
		 	 alert("Great!! You Are Right");
		 	 count=3;
	    	 }
	 }
	 var output= (Response==answer)?correct:incorrect;
	 document.write("<br>");
	 document.write(output);
</script>
</head>
<body>
</body>
</html>

#6106 From: ibi_edu@yahoogroups.com
Date: Sun Dec 9, 2012 11:37 am
Subject: File - image001.gif
ibi_edu@yahoogroups.com
Send Email Send Email
 
File        : image001.gif
Description :

#6107 From: ibi_edu@yahoogroups.com
Date: Sun Dec 9, 2012 11:37 am
Subject: File - car_delete_action.cfm
ibi_edu@yahoogroups.com
Send Email Send Email
 
<cfinclude template="Includecar.html">

<cfquery datasource="car">
	 DELETE
		 FROM car
		 where ModelNo='#form.ModelNo#'

</cfquery>
<html>
<head>
<title>The selected record is deleted</title>
</head>
<body bgcolor="#FF4FA7">
<font color="#FFFFFF">
<h2>Thanks For Submitting Your Entry.</h2>
<br><hr>
<b>The Record for Car Model <i> <cfoutput>#form.ModelNo#</cfoutput> </i> Has
Been Deleted.</b>
<br>
</font>
</body>
</html>

#6108 From: ibi_edu@yahoogroups.com
Date: Sun Dec 9, 2012 11:37 am
Subject: File - HGame.cpp
ibi_edu@yahoogroups.com
Send Email Send Email
 
/**************#####################****************
program by Shreeharsha Perla
you are free to use, modify or distribute this program.
for more programs, keep on visiting 'downloads' page in my site

website:  www.ibi_edu.yahoogroups.com
email:    ibi_edu@...

IBRAHEEM-JAVED
Asian College
Punjab university
Gujranwala
Pakistan

simple game.
Try to sort the number in ascending order.

  **************#####################****************/


#include"graphics.h"
#include"time.h"
#include<conio.h>
#include<stdio.h>                  /* sorting game */
#include<stdlib.h>
void check(int [4][4]);

void main()
{
    int i,j,n[4][4],key,x1=200,y1=200,mx,my;
    int gd=DETECT,gm=EGAHI;
    int cx,cy,level=1;

    srand(time(NULL));

    initgraph(&gd,&gm,"c:\\tc\\bgi");
    settextstyle(1,0,6);
    setcolor(4);
    outtextxy(130,200,"IBI BEST OF LUCK");
    setcolor(YELLOW);
    outtextxy(132,202,"IBI BEST OF LUCK");
    settextstyle(3,0,2);
    outtextxy(172,404,"Hello Press any key to start");
    getch();

do{
     clearviewport();
    for(i=0;i<=3;i++)
    {
       for(j=0;j<=3;j++)                /* clear all the blocks */
       {
	   n[i][j]=0;

       }
    }

    for(i=1;i<=15;i++)
    {
       do
       {
	  mx=rand()%4;
	  my=rand()%4;          /* fill numers from 1 to 15 in empty blocks */
       } while(n[mx][my]);
       n[mx][my]=i;
     }
    rectangle(180,180,420,420);
    setcolor(RED);
    rectangle(182,182,418,418);
    rectangle(184,184,416,416);
    setcolor(YELLOW);
    rectangle(186,186,414,414);

    gotoxy(2,2);
    printf("  exit: Esc              restart: Ctrl+R                   move: 
Arrows\nIBRAHEEM-JAVED MALIK \t\t\tClass:BCS");
    setcolor(1);
    my=0;
     do
    {
       for(i=0;i<=3;i++)
	  {
	    for(j=0;j<=3;j++)
	    {
	       setfillstyle(SOLID_FILL,n[i][j]);
	       bar(x1+i*50+2,y1+j*50+2,x1+50+i*50,y1+50+j*50);

	       gotoxy(29+6*i,15+3*j);
	       if(n[i][j]!=0)
		  printf("%d",n[i][j]);
	       else
		  {
		     printf(" ");
		     cx=i; cy=j;
		  }
	    }
	  }
       key=getch();

       mx=0;
       switch (key)
       {
       case 75:                               /* movements of numbers */
	       if (cx==3) break;
	       n[cx][cy]=n[cx+1][cy];
	       n[cx+1][cy]=0;
	       mx=1;
	       break;
       case 72:
	       if(cy==3) break;
	       n[cx][cy]=n[cx][cy+1];
	       n[cx][cy+1]=0;
	       mx=1 ;
	       break;
       case 80:
	       if(cy==0) break;
	       n[cx][cy]=n[cx][cy-1];
	       n[cx][cy-1]=0;
	       mx=1;
	       break;
       case 77:
	       if(cx==0) break;
	       n[cx][cy]=n[cx-1][cy];
	       n[cx-1][cy]=0;
	       mx=1;

       }

       gotoxy(14,10);
       if(mx==1)
	  {
	       printf(" * good move *  ");
	       my++;
	       rectangle(10, 100, my+10, 80);
	       printf("\t\t       No. of moves: %d       ",my);
	       if(my>650)
		  {
		     my=1;
		     level++;
		     setcolor(level%16);
		  }

	  }
       else printf("which side?   ");        /* bad key */
       check(n);
     }while(key!=27 &&key!=18);

}while(key==18);        /* (Ctrl) restart */


    closegraph();

}
void check(int order[4][4])        /*  check how many numbers are in orrect */
{                                  /*  position                             */
    int t=0,ox,oy,state=0,diff;

    for( ox=0;ox<=3;ox++)
       {
	   for (oy=0;oy<=3;oy++)
	   {
	      t=(t++ %16);
	      if(t==order[oy][ox]) state++;

	   }
       }
       gotoxy(14,11);
       printf(" %d numbers are in correct position.",state);
       if(state<5)
	   puts(" Try to improve       ");
       else if(state <10)
	   puts(" You can do it         ");
       else if( state<13 )
	   puts("  Very GOOD...Come on,  ");
       else printf("  You are realy Great    ");

       if(state==15)
       {
	  setcolor(2);
	  outtextxy(131,451," -CONGRAGULATIONS-YOU DID IT-");
	  setcolor(12);
	  outtextxy(130,450," -CONGRAGULATIONS-YOU DID IT-");
       }
}

#6109 From: ibi_edu@yahoogroups.com
Date: Sun Dec 9, 2012 11:37 am
Subject: File - june.gif
ibi_edu@yahoogroups.com
Send Email Send Email
 
File        : june.gif
Description : june

#6110 From: ibi_edu@yahoogroups.com
Date: Sun Dec 9, 2012 11:37 am
Subject: File - Sum and Product.html
ibi_edu@yahoogroups.com
Send Email Send Email
 
<html>
<head>
<script language="javascript">
	  var No = prompt ("How many Numbers You want to sum and product  : ","");
 	   Num = new Array(No);
	  var i=0;
	  var Sum=0;
	  var Pro=1;
	 for( i=1 ; i<=No ; i++ )
	  {
 	   Num[i] = prompt ("Enter the value of " + i + "","");
		 Sum = parseInt (Num[i]) + Sum;
		 Pro = parseInt (Num[i]) * Pro;
 	  }
  		 document.write("The Total Sum Of  " + (i-1) + " Values : " , Sum  + "<br>");

  		 document.write("The Total Product Of  " + (i-1) + " Values : " , Pro);

</script>
<body bgcolor="#9966FF">
</body>
</head>
</html>

#6111 From: ibi_edu@yahoogroups.com
Date: Sun Dec 9, 2012 11:37 am
Subject: File - verification.html
ibi_edu@yahoogroups.com
Send Email Send Email
 
<html>
	 <head>
		 <title>
				 alert functions calling
		 </title>
	 <script language="javascript">

		 function verify()
		 {
			 for ( i = 0; i<=7; i++ )
			  {
			 	 if(document.forms[0].elements[i].value=="")
					 {
						 alert("Please fill in the " + document.forms[0].elements[i].name +
"field");
						 document.forms[0].elements[i].focus();
						 return(false);
					 }


				 if(document.forms[0].elements[1].value=!"")
					 {
						 pass = document.forms[0].elements[1].value.indexOf('@',0);
						 pass1 = document.forms[0].elements[1].value.indexOf('.',0);
						 if(( pass==-1 )||(pass1==-1))
							 {
								 alert("not a valid "+ document.forms[0].elements[1].name + " field");
								 document.forms[0].elements[1].focus();
								 return(false);
							 }

			  		 }
			   }

			 return(true);
		 }









		  function checklen()
		  {
		 	 for(i = 0; i <= 1; i++)
				 {
				 	 val = document.forms[0].elements[i].value;
					 len = val.length;
					 if(len > 20)
					   {
					  	 alert("Values Exceeds 20 Characters");
						 document.forms[0].elements[i].value ="";
						 document.forms[0].elements[i].focus();
					   }
				 }
		  }



		  function abort(form)
		  {
		 	 history.back();

		  }

		  function set(form)
		  {
		 	 document.forms[0].elements[0].focus();
		  }



	     </script>
	 </head>

	 <param name=movie value="matrix.swf">
<param name=quality value=autohigh>
<param name=menu value=false>
<param name=bgcolor value=#000000>
<embed src="matrix.swf" quality=autohigh menu=false
bgcolor=#000000
pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Vers\
ion=ShockwaveFlash" type="application/x-shockwave-flash" width="982"
height="550"></embed></object>

	 <body bgcolor="#000000" onLoad="set(this.form)">
	 <font color="#CCCCCC" face="Times New Roman, Times, serif" size="+2">
	 <center>
	 <img src="june.gif" width="40" height="110">
	 </center>
	 <p>
	 <p>
	 <center>
	 <p>

	 <form action="" method ="post" onSubmit="return verify()">
	 <p>

	 Please Enter your name :
	    <input type="text" name="name" size="30" onBlur="checklen()">
	   <br>
	 <p>

	 Plese Enter your E-mail Address : <input type="text" name="emailid" size="30"
onBlur="checklen()"><br>

	 <center>

		 <input type="submit" value="submit" name="submit">
		 <input type="reset" value="reset" name="submit">
		 <input type="button" value="abort" name="at" onClick="abort(this.form)">
	 </center>

	 </form>
	 </body>

	 </html>

#6112 From: ibi_edu@yahoogroups.com
Date: Sun Dec 9, 2012 11:37 am
Subject: File - matrix.swf
ibi_edu@yahoogroups.com
Send Email Send Email
 
File        : matrix.swf
Description : matrix

#6113 From: ibi_edu@yahoogroups.com
Date: Sun Dec 23, 2012 11:37 am
Subject: File - CIRCLE1.CPP
ibi_edu@yahoogroups.com
Send Email Send Email
 
#include<stdio.h>
#include<iostream.h>
#include<conio.h>
#include <graphics.h>
#include <stdlib.h>
class Circle
{
	 private :
			   //  help  //
	 // midx and midy are used pixel on the mid of the screen
    int midx, midy;
	 // move_x and move_y are used to move circle along x-axis and y-axis
    int move_x,move_y;
			  //--help--//
    int radius;

        public:
	       void get_radius();
	       void get_x_axis();
	       void get_y_axis();
	       void center_of_screen();
	       void draw_circle();
	       void put_pixel();
        };

	 void Circle::get_radius()
	  {
	      cout<<"\n\n\n\t\t Enter the radius of the circle : ";
	      cin>>radius;
	  }
	 void Circle::get_x_axis()
	  {
	     cout<<"\t\t Enter the value of x to move the circle : ";
	     cin>>move_x;

	  }

	 void Circle::get_y_axis()
	  {
	     cout<<"\t\t Enter the value of y to move the circle : ";
	     cin>>move_y;

	  }
	 void Circle::center_of_screen()
	  {
	        midx = 319;
	        midy = 239;
	  }
	 void Circle::draw_circle()
	  {

		  /* draw the circle */
	    circle(midx+move_x, midy-move_y, radius);
		  /* clean up */
	    getch();
	  }

	 void Circle::put_pixel()
	  {
	    putpixel(319+move_x, 239-move_y,15);
	    getch();
	  }

void main(void)
        {
	 Circle circle;
	  clrscr();

	  circle.get_radius();
	  circle.get_x_axis();
	  circle.get_y_axis();
	  circle.center_of_screen();
	  clrscr();

			    /* request auto detection */
		    int gdriver = DETECT, gmode;

		 /* initialize graphics and local variables */
		 initgraph(&gdriver, &gmode, "c:\\tc\\bgi");

	  circle.put_pixel();
	  circle.draw_circle();

	  closegraph();

	  getch();


        }

#6114 From: ibi_edu@yahoogroups.com
Date: Sun Dec 23, 2012 11:37 am
Subject: File - MIDELLIP.CPP
ibi_edu@yahoogroups.com
Send Email Send Email
 
# include <iostream.h>
  # include <graphics.h>
  # include    <conio.h>
  # include     <math.h>


  class Ellipse
  {
	 private:

	 public:
		 void show_screen( );
		 void Lines();
		 void midpoint_ellipse(float,float,float,float);
		 void angle_ellipse(float,float,float,float);

  };

  void Ellipse::Lines()
  {
  setcolor(2);
  line(0,240, 640, 240);
  line(320,0,320,480);

  }

  void Ellipse::midpoint_ellipse(float xc, float yc,float a, float b)
     {
        float color=11;

        float aa=(a*a);
        float bb=(b*b);
        float aa2=(aa*2);
        float bb2=(bb*2);

        float x=0;
        float y=b;

        float fx=0;
        float fy=(aa2*b);

        float p=(float)(bb-(aa*b)+(0.25*aa)+0.5);

        putpixel((xc+x),(yc+y),color);
        putpixel((xc+x),(yc-y),color);
        putpixel((xc-x),(yc-y),color);
        putpixel((xc-x),(yc+y),color);

        while(fx<fy)
	   {
	      x++;
	      fx+=bb2;

	      if(p<0)
		 p+=(fx+bb);

	      else
		 {
		    y--;
		    fy-=aa2;
		    p+=(fx+bb-fy);
		 }

	      putpixel((xc+x),(yc+y),color);
	      putpixel((xc+x),(yc-y),color);
	      putpixel((xc-x),(yc-y),color);
	      putpixel((xc-x),(yc+y),color);
	   }

        p=(float)((bb*(x+0.5)*(x+0.5))+(aa*(y-1)*(y-1))-(aa*bb)+0.5);

        while(y>0)
	   {
	      y--;
	      fy-=aa2;

	      if(p>=0)
		 p+=(aa-fy);

	      else
		 {
		    x++;
		    fx+=bb2;
		    p+=(fx+aa-fy);
		 }

	      putpixel((xc+x),(yc+y),color);
	      putpixel((xc+x),(yc-y),color);
	      putpixel((xc-x),(yc-y),color);
	      putpixel((xc-x),(yc+y),color);
	   }
     }



void Ellipse::angle_ellipse(float x_dash,float y_dash,float a,float b)
     {
        float color=13;

        float aa=(a*a);
        float bb=(b*b);
        float aa2=(aa*2);
        float bb2=(bb*2);

        float x=0;
        float y=b;

        float fx=0;
        float fy=(aa2*b);

        float p=(float)(bb-(aa*b)+(0.25*aa)+0.5);

        putpixel((x_dash+x),(y_dash+y),color);
        putpixel((x_dash+x),(y_dash-y),color);
        putpixel((x_dash-x),(y_dash-y),color);
        putpixel((x_dash-x),(y_dash+y),color);

        while(fx<fy)
	   {
	      x++;
	      fx+=bb2;

	      if(p<0)
		 p+=(fx+bb);

	      else
		 {
		    y--;
		    fy-=aa2;
		    p+=(fx+bb-fy);
		 }
	      putpixel((x_dash+x),(y_dash+y),color);
	      putpixel((x_dash+x),(y_dash-y),color);
	      putpixel((x_dash-x),(y_dash-y),color);
	      putpixel((x_dash-x),(y_dash+y),color);

	      }

        p=(float)((bb*(x+0.5)*(x+0.5))+(aa*(y-1)*(y-1))-(aa*bb)+0.5);

        while(y>0)
	   {
	      y--;
	      fy-=aa2;

	      if(p>=0)
		 p+=(aa-fy);

	      else
		 {
		    x++;
		    fx+=bb2;
		    p+=(fx+aa-fy);
		 }

	      putpixel((x_dash+x),(y_dash+y),color);
	      putpixel((x_dash+x),(y_dash-y),color);
	      putpixel((x_dash-x),(y_dash-y),color);
	      putpixel((x_dash-x),(y_dash+y),color);
	   }
     }

void Ellipse::show_screen( )
     {
        restorecrtmode( );
        textmode(C4350);

        textbackground(1);
        cprintf(" MidPoint Ellipse Algorithm ");
        textbackground(8);
     }

  float main( )
     {
     Ellipse e;
        int  driver=VGA;
        int mode=VGAHI;

        double  theta;
        float xc=0;
        float yc=0;
        float rx=0;
        float ry=0;
        float x_dash;
        float y_dash;

        do
	   {
	      e.show_screen( );

	      gotoxy(8,10);
	      cout<<"Central Points of the Ellipse : (xc,yc) :";

	      gotoxy(8,11);
	      cout<<"ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ";

	      gotoxy(12,13);
	      cout<<"Enter the value of xc = ";
	      cin>>xc;
	      xc = xc + 320;
	      gotoxy(12,14);
	      cout<<"Enter the value of yc = ";
	      cin>>yc;
	      yc = yc + 240;

	      gotoxy(8,18);
	      cout<<"Radius of the Ellipse : (rx,ry) :";

	      gotoxy(8,19);
	      cout<<"ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ";

	      gotoxy(12,21);
	      cout<<"Enter the radius along x-axis : rx = ";
	      cin>>rx;

	      gotoxy(12,22);
	      cout<<"Enter the radius along y-axis : ry = ";
	      cin>>ry;
	      gotoxy(12,24);
	      cout<<"Enter the Angle of the Ellipsea : theta = ";
	      cin>>theta;
	      double r  = theta * 11/630;

	      x_dash = xc * cos(r) - yc * sin(r);
	      y_dash = xc * sin(r) + yc * cos(r);

	      initgraph(&driver,&mode,"c:/tc/bgi");

	      setcolor(9);

	       //-----------calling functions-----------
	        e.Lines();
	        e.midpoint_ellipse(xc,yc,rx,ry);        //Simple Ellipse
	        e.angle_ellipse(x_dash,y_dash,rx,ry);   //Rotation Ellipse


	      setcolor(11);
	        outtextxy(110,460,"Press <any> to continue or Escape key to exit.");

	      float key=float(getch( ));

	      if(key==27) break;
	   }
        while(1);

        return 0;
     }

#6115 From: ibi_edu@yahoogroups.com
Date: Sun Dec 23, 2012 11:37 am
Subject: File - CIRCLE2.EXE
ibi_edu@yahoogroups.com
Send Email Send Email
 
File        : CIRCLE2.EXE
Description :

#6116 From: ibi_edu@yahoogroups.com
Date: Sun Dec 23, 2012 11:37 am
Subject: File - GAMEPACK.CPP
ibi_edu@yahoogroups.com
Send Email Send Email
 
//Game Pack in C++.

#include<string.h>
#include<math.h>
#include<graphics.h>
#include<dos.h>
#include<stdlib.h>
#include<stdio.h>
#include<conio.h>
#include<iostream.h>
#include<process.h>
#include<time.h>
void main();
int temp_life;
int i=8,j=18,a[20][20],ri,rj,max=2,speed=2,op_graph=0;
int score=0,nbox=5,life=5,level=1;

clock_t start, end;
void draw(int);
void drawbox(int);
void decr();
void genbox();
void shotbox(int);
void strt();
void putscore(int);
void lifebox(int );

int global=9;int open_times=0,prev_card=0,comp=0;

void card(int left,int top,int right,int bottom)
{
int x,y;
long int er=0;
if(global==9)
er=2000;
else
er=200;
for (long double g=0;g<er;g++)
{
		  x=random(right);
		  y=random(bottom);
		  if(x<left)
		  {
		  g--;
		  continue;
		  }

		  if(y<top)
		  {
		  g--;
		  continue;
		  }

		  int colors=random(15);

		  if(colors==1||colors==10)
		  {
		  g--;
		  continue;
		  }
		  setcolor(BLACK);
		  setfillstyle(SOLID_FILL,colors);
		  bar3d(x-4,y-4,x+4,y+4,1,1);



		  }
}
void open(int left[],int top[],int right[],int bottom[],int game[],int z)
{
sound(900);
delay(16);
nosound();


int x;
global=909;

		  for(int j=left[z],k=top[z],l=right[z],i=bottom[z];j<=right[z];j++)
		  {

		  setfillstyle(SOLID_FILL,BLACK);
		  bar(j+1,k,l+1,i+1);
		  setcolor(WHITE);
		  rectangle(j+1,k,l+1,i+1);
		  sound(j*20);
		  delay(5);
		  nosound();
		  }


		  int number=game[z];
		  char string[5];
		  setcolor(BLACK);
		  settextstyle(TRIPLEX_FONT,HORIZ_DIR,1);
		  outtextxy(left[z]+25,top[z]+35,itoa(number, string, 10));

		  if(open_times==0)
		  prev_card=z;

		  if(open_times==1)
		  if(game[z]==game[prev_card])
		  game[prev_card]=game[z]=-100;

		  open_times++;

		  if(open_times==2)
		  for(int k=0,t=19,b=99;k<4;k++,t+=120,b+=121)     //displaying cards
		  for(int i=0,l=55,r=125;i<4;i++,l+=150,r+=150)
		  {
		  sound(1000);
		  delay(60);
		  nosound();

		  if(k==0 && i==0) delay(90);
		  card(l,t,r,b);
		  open_times=0;
		  }

}

void menu(int a,int b,int c,int d,int e)
{
  setcolor(a);
  settextstyle(TRIPLEX_FONT,HORIZ_DIR,7);
  outtextxy(22,100,"1. BRICKS");

  setcolor(b);
  settextstyle(TRIPLEX_FONT,HORIZ_DIR,7);
  outtextxy(22,200,"2. PAIRS II");

  setcolor(c);
  settextstyle(TRIPLEX_FONT,HORIZ_DIR,4);
  outtextxy(15,300,"3. HELP");

  setcolor(d);
  settextstyle(TRIPLEX_FONT,HORIZ_DIR,4);
  outtextxy(15,350,"4. CREDITS");

  setcolor(e);
  settextstyle(TRIPLEX_FONT,HORIZ_DIR,4);
  outtextxy(15,400,"5. EXIT");

}

void open_graph()
{
     int   x_center = 320, y_center = 240, rad = 220;
     int   z,k,x[10],y[10];

     setcolor(4);
     for(int xi=30;xi>4;xi--)
     {
     sound(xi*20);
     settextstyle(GOTHIC_FONT,HORIZ_DIR,xi);
     outtextxy(xi,220,"Gaming begins here......");
     delay(320);
     cleardevice();
     }
     setcolor(10);
     for (z=0;z<10;z++)
     {
        x[z]=x_center+rad*cos(36*z*3.14159/180);
        y[z]=y_center+rad*sin(36*z*3.14159/180);
     }
     for (z=0;z<10;z++)
     for (k=0;k<10;k++)
		    {
		    sound(k*200);
		    delay(50);
		    line(x[z],y[z],x[k],y[k]);
		    nosound();
		    }

    for(int h=0;h<500;h++)
    {
    sound(h*9);
setfillstyle( random(12),random(15) );
bar3d(random(640),random(480),random(640),random(480),random(30),
random(18));
    }
   op_graph++;
}
void loading()
{
cleardevice();
   setcolor(13);
   settextstyle(TRIPLEX_FONT,HORIZ_DIR,0);
   setusercharsize(2, 1, 1, 1);
   outtextxy(138,198,"LOADING");              //LOADING
   setcolor(13);
settextstyle(TRIPLEX_FONT,HORIZ_DIR,0);
setusercharsize(2, 1, 1, 1);

setcolor(BLUE);
rectangle(119,199,421,231);
rectangle(118,198,422,232);
setcolor(10);
for(int ii=120;ii<=420;ii++)
{
line(ii,200,ii,230);
sound(ii+1500);
delay(10);
nosound();
}

}
void gameover()
{
cleardevice();
settextstyle(GOTHIC_FONT,0,10);
cout<<"a";
for(int g=0;g<450;g++)
{
sound(g*10);
delay(3);
setcolor(LIGHTRED);
if(g%20==0) {cleardevice();setcolor(12);}
outtextxy(70,g,"game over");
nosound();
}
main();
}

void main()
{
  clrscr();
  int gdriver = DETECT, gmode;
  initgraph(&gdriver, &gmode, "c:\\tc\\bgi");
  cleardevice();
  if(op_graph==0) open_graph();

  settextstyle(TRIPLEX_FONT,HORIZ_DIR,0);
  for(int si=1;si<10;si++)
  {
   sound(si*850);
   setcolor(LIGHTCYAN);
   setusercharsize(si,1,si,1);
   outtextxy(13,150,"IBRAHEEM JAVED GAME PACK");
   delay(250);
   nosound();
   cleardevice();
   }

  randomize();
  setfillstyle(3,RED);
  bar3d(0, 0,639,479, 0, 0);//background

  setcolor(WHITE);
  settextstyle(4,HORIZ_DIR,7);
  outtextxy(220,25,"IBI MENU");

  char lion;
  int move=5;

  lion=getch();
  while(lion!=27)
  {

   if(lion==13)  break;
   if(lion=='P') move++;
   if(lion=='H') move--;

   if(move<1)move=5;
   if(move>5)move=1;

   if(move==1)  menu(10,8,8,8,8);
   if(move==2)  menu(8,10,8,8,8);
   if(move==3)  menu(8,8,10,8,8);          //7 gray 14-yellow
   if(move==4)  menu(8,8,8,10,8);
   if(move==5)  menu(8,8,8,8,10);

   lion=getch();
   sound(1700);
   delay(7);
   nosound();
  }
  cleardevice();
  if(move==5) exit(0);



  if(move==1)
  {
   //bricks video game shooting  prg.

  loading();

  int gd=DETECT,gm;
  initgraph(&gd,&gm,"c:\\tc\\bgi");

  setcolor(10);
  outtextxy(500,75,"score :");
  outtextxy(500,150,"level :");
  outtextxy(500,225,"Life");
  lifebox(10);
  putscore(10);
  getch();
  strt();
  getch();
  }
/*
   PAIRS II

*/
if(move==2)
{
int a[8],game[16],i=0,z=8,k,flag,temp,t,b,l,j=0,u=0,o=0,p=0;
int left[16],top[16],right[16],bottom[16];

randomize();

loading();

for(int ii=0;ii<=640;ii++)
line(ii,0,ii,480);

setcolor(1);
for(ii=0;ii<=640;ii++)
line(0,ii,640,ii);

setcolor(3);
for(ii=640;ii>=0;ii--)
line(ii,0,ii,480);

setcolor(BLUE);
for(ii=640;ii>=0;ii--)
line(0,ii,640,ii);

setcolor(RED);
for(ii=0;ii<=640;ii++)
{
sound(ii*5);
line(640,ii,ii,480);
delay(5);
nosound();
}

setcolor(0);
for(ii=0;ii<=640;ii++)
{
sound(ii*5);
line(0,ii,640,480);
delay(2);
nosound();
}


//selecting 8 nos (1-100)without repeating
randomize();
a[0]=random(100);
while(i!=8)
{
redo:
temp=random(100);
flag=1;
for(k=0;k<=i;k++)
if(a[k]==temp){flag=5;break;}
if (flag==5) goto redo;
else
{
a[i++]=temp;
game[z++]=temp;
}
}

//randomly filling the 8 nos from an array without repeating
int r=0;
while(r!=8)
{
label:
temp=a[random(8)];
flag=1;
for(k=0;k<=r;k++)
if(game[k]==temp){flag=5;break;}
if (flag==5) goto label;
else
game[r++]=temp;
}

setfillstyle(11,RED);
setcolor(YELLOW);
bar(0, 0,638,478);//backgrond

for(k=0,t=19,b=99;k<4;k++,t+=120,b+=121)     //displaying cards
for(i=0,l=55,r=125;i<4;i++,l+=150,r+=150)
{
left[j++]=l;
top[u++]=t;
right[o++]=r;
bottom[p++]=b;
sound(i*200);
card(l,t,r,b);
}
nosound();
for(int you=1;you<=20;you++)
{
if(you%2)
setcolor(LIGHTGREEN);
else
setcolor(RED);
for(k=0,t=15,b=103;k<4;k++,t+=120,b+=121)      //high light cursor
for(i=0,l=50,r=130;i<4;i++,l+=150,r+=150)
for(int we=1;we<=5;we++)
{
sound(we*900);
rectangle(l-we,t-we,r+we,b+we);
nosound();
}
delay(100);
}


setcolor(0);
char ch=getch();
int pntr=0,turn=1;

while(ch!=27)
{

		  if(ch=='M') pntr++;
		  if(ch=='K') pntr--;
		  if(ch=='H') pntr=pntr-4;
		  if(ch=='P') pntr+=4;

		  if(pntr>=17)
		  pntr=pntr-16;

		  if(pntr<1)
		  pntr=pntr+16;

		  int m=1;
		  if(open_times==1)
		  if(pntr-1==prev_card)
		  {
				  ch=getch();
				  continue;
		  }
int var_new34=9;

if(game[pntr-1]==-100)
var_new34=0;

		  end:
		  for(k=0,t=15,b=103;k<4;k++,t+=120,b+=121)      //high light cursor
		  for(i=0,l=50,r=130;i<4;i++,l+=150,r+=150)
		  {

				  setcolor(BLACK);
				  if(m==pntr)
				  {
						  setcolor(LIGHTGREEN);
						  if(game[pntr-1]==-100)
						  setcolor(LIGHTRED);
				  }

				  for(int we=1;we<=5;we++)
				  rectangle(l-we,t-we,r+we,b+we);
				  m++;
		  }

if(var_new34)
if(ch==13)
open(left,top,right,bottom,game,pntr-1);     //open card


int y=0;
for(int wer=0;wer<16;wer++)
if(game[wer]==-100)
y++;
if(y==16) gameover();

  ch=getch();
  sound(2500);
  delay(6);
  nosound();
  }
  if(ch==27) main();

}

if(move==3)
{
char ctrl;
do
  {


char help_topic[]="***************USERS\nMANUAL\t\t\t\tIBRAHEEM-JAVED\n1. PAIRS
II\n\nThe general outline of the game is as follows.\nIt is basically a card
game.\n One can flip and see only two cards at a\ntime simultaneously in the
given set of cards.\n One has to match the\ncards in the given set.\n One wins
the game if all the matches are made\ncorrectly.\n This game is a time-trailed
game i.e. one's score becomes\ninvalid if it exceeds the tine limit.\n To
navigate one can use the arrow\nkeys.\n To open the card  you can hit enter.\n";
char help_brick[]="\n BRICKS\nThe general outline is as follows.\nIt is\na brick
game.\nIt consist of a shooting box and we have to shoot the\nbricks.\nTo move
the shooting box right press the right direction key and\nto move left press the
left direction key.\nTo shoot press the up\ndirection key.\nBasically there are
5 levels in the game.\nYou can win\neach level when u reach the score of
2500.\nWhen u hit each brick you get\n25 points.\nBut if the bricks touch the
shooting box or if it touches the\nground one of your life is lost.\nIn total
there are 5 lives.";
textcolor(10);
for(int i=0;i<strlen(help_topic);i++)
{
		  sound(i*20);
		  cout<<help_topic[i];
		  delay(15);
		  nosound();
}
int cv;
for(i=0,cv=2000;i<strlen(help_brick);i++,cv--)
{
		  sound(cv*2);
		  cout<<help_brick[i];
		  delay(15);
		  nosound();
}

  ctrl=getch();
  }while(ctrl!=27&&ctrl<28&&ctrl>25);
  if(ctrl==27)
  main();
}


if(move==4)
{
  cleardevice();
  setcolor(LIGHTGREEN);
  settextstyle(TRIPLEX_FONT,HORIZ_DIR,0);
  setusercharsize(1,1,1,1);

  setcolor(LIGHTGREEN);
  settextstyle(TRIPLEX_FONT,HORIZ_DIR,6);
  outtextxy(320,250,"&");

  setcolor(LIGHTGREEN);
  rectangle(1,1,638,478);//background
  for(int ab=5,bc=420;ab<350;ab++,bc--)
  {
  sound(ab*620);

  setfillstyle(6,BLACK);
  bar(5, 130,637,250);
  bar(9,350,635,450);

  setcolor(random(15));
  settextstyle(TRIPLEX_FONT,HORIZ_DIR,6);

  settextstyle(TRIPLEX_FONT,HORIZ_DIR,6);
  sound(bc*2000);
  delay(1);
  nosound();
  }
sleep(1);
main();
}


}//void main's block

void strt()
{
int op;
setcolor(0);
line(60+i*25,j*25,60+rj*25,ri*25);

for(ri=0;ri<19;ri++)
for(rj=0;rj<16;rj++)
a[ri][rj]=0;
randomize();
genbox();
drawbox(12);
start=clock();
op=getch();
while(1)
{
while(!kbhit())
{

end = clock();
if((end - start) / CLK_TCK > speed)
{
decr();
start=clock();
}

}

while(kbhit())
{
op=getch();
switch(op)
{
case 77:
draw(0);
if(i<15) i++;
draw(10);
break;
case 75:
draw(0);
if(i>0) i--;
draw(10);
break;
case 72:
        shotbox(i);
        break;
case 27:main();
}
}

}


}

void draw(int color)
{
int c;
c=getcolor();
setcolor(color);
setfillstyle(INTERLEAVE_FILL,color);
bar(50+25*i,j*25,75+25*i,j*25+25);
rectangle(50+25*i,j*25,75+25*i,j*25+25);
setcolor(14);
rectangle(50,0,450,475);

setcolor(c);
}


void genbox()
{
int x;
for(x=0;x<nbox;x++)
{
rj=rand()%16;
if(a[0][rj]==1) x--;
a[0][rj]=1;
}
}




void decr()
{
if(max<17)
{
drawbox(0);
for(ri=max;ri>=0;ri--)
for(rj=0;rj<16;rj++)
a[ri+1][rj]=a[ri][rj];
for(rj=0;rj<16;rj++)
a[0][rj]=0;
genbox();
drawbox(12);
}
else
{
printf("a");
lifebox(0);
--life;
lifebox(10);
if(life==0) gameover();


else {drawbox(0);strt();}
}
}

void drawbox(int c)
{
setcolor(c);

for(ri=0;ri<18;ri++)
for(rj=0;rj<16;rj++)
      if(a[ri][rj]==1)
      {
      max=ri;
      setfillstyle(INTERLEAVE_FILL,c);
      bar(50+rj*25,ri*25,50+rj*25+25,ri*25+25);
      if(c!=0) setcolor(14);
      rectangle(50+rj*25,ri*25,50+rj*25+25,ri*25+25);
      }
setcolor(14);
rectangle(50,0,450,475);
}


void shotbox(int rj)
{
int ri,r;
drawbox(0);
for(ri=18;ri>=0;ri--)
if(a[ri][rj]==1)
{a[ri][rj]=0;

file://for(r=18;r>=ri;r--)
setcolor(13);
line(60+i*25,j*25,60+rj*25,ri*25);
sound(480);
delay(25);
nosound();

putscore(0);
if(score%100==0 && score!=0 )
{

putscore(0);
level++;
putscore(10);

if(speed==1)
if(nbox==5) nbox=7;
else if(nbox==7) nbox=9;
else if(nbox==9) nbox=11;
else
{
setcolor(10);
drawbox(12);
cout<<"a";
cleardevice();
gameover();
main();
}
else speed--;
putscore(0);
score++;
putscore(10);
strt();break;}
else{
score++;
putscore(10);
break;}}
drawbox(12);
setcolor(0);
line(60+i*25,j*25,60+rj*25,ri*25);


}
void putscore(int color)
{
char str[20];
int c;
c=getcolor();
setcolor(color);
itoa(score*25,str,10);
outtextxy(550,75,str);
itoa(level,str,10);
outtextxy(550,150,str);
setcolor(c);
}

void lifebox(int color)
{
int i,c;
c=getcolor();
setcolor(color);
for(i=1;i<=life;i++)
{
setfillstyle(INTERLEAVE_FILL,color);
bar(500,250+i*25,525,275+i*25);
if(color) setcolor(14);
rectangle(500,250+i*25,525,275+i*25);
}
setcolor(c);
}

Messages 6087 - 6116 of 6531   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help