This is an article you will rarely find on the web. If you have WinVista running but for some reasons you want to install WinXP. Then here is guide

Simply boot from WinXP CD and install XP on any partition other than partition where you have installed WinVista

After installation you will have no boot prompt to run WinVista.

Download and install EasyBCD

Run it you will get this error. Click Yes

1.jpg

Now Select C Drive (this is the active or boot drive)

2.jpg

Select the Drive where WinVista was installed mine D:\

3.jpg

You will see this message. Click OK

Installing Windows XP Over Windows Vista Without Losing Windows Vista

You will see the following box

5.jpg

Go to Add/Remove Entries Section. You will need to enter the Details where XP is installed. Select Windows NT/2k/XP/2k3 in Type: box and in the Name: Type Windows XP, Now in the Drive box select the Drive where you have installed XP recently. Then Click Add Entry and then Save. You can also Select which Entry should be Up and which should be Down

6.jpg

After adding WinXP boot entry Go to Change Settings Section and Select which OS should be default and alos enter 30 as the Bootloader Timeout: , Now Save Settings.

8.jpg

And you are done! Better luck

What is Windows Genuine Advantage Notification?

WGA_Logo Windows Genuine Advantage is a software anti-piracy program started by Microsoft in 2005. It enforces the online validation of some of the Microsoft products. It is automatically installed if Windows Automatic Updates are enabled. If goes to the Windows Update site, it will ask you for installing this validation tool before you can select the updates from the Microsoft update website. By accepting to install this validation tool, an ActiveX component in Internet Explorer is installed.

What does it do?

If, for some reason, this tool fails to

validate your Windows, then it’ll always show you a warning that you may be a victim of software counterfeiting and that your Windows is not genuine. It will show up on your logon screen and make you wait for some seconds. And when you logon, it will just site in your status bar and will keep annoying you.

Here is the description of Windows Genuine Advantage Tool from Microsoft.

When this tool is installed, it shows up before logging on to the system

wgalogon

And keeps on displaying the balloons in the status bar.

Windows Vista

wgavistanotify

Windows XP

wgaxpnotify

What data does WGA collect?

This tool, if installed, collects the following data from the system.

  • Computer make and model
  • BIOS checksum.
  • MAC address.
  • GUID
  • Hard drive serial number.
  • Region and language settings of the operating system.
  • Operating system version.
  • PC BIOS information (make, version, date).
  • PC manufacturer.
  • User locale setting.
  • Validation and installation results.
  • Windows or Office product key.
  • Windows XP product ID.

How to remove WGA notification:

There are several ways to disable WGA notification. Some of them are given below:

1- Through Firewall

WGA notification can easily be disable through your firewall. You can disable the automatic startup of wgatray.exe and wgalogon.dll through your firewall. This will disable WGA notifications and this will do no harm to the system.

2- Through third party softwares

There are many softwares available which can disable WGA notifications. Notable softwares include WGARemover and MUBlinder.

3- Through System Restore

If you have installed WGA by mistake, you can always use your system restore to get rid of it. Restore your system to the point where WGA was not installed.

4- Through deleting files manually

To remove WGA manually, follow the steps below:

  • Download this bat file
  • Double click it and restart your system
  • Most probably, you have successfully deleted all the files used by WGA. Now it should not come at logon.

If this bat file does not work, you should manually delete the following files from your system:

  • X:\Windows\System32\wgatray.exe
  • X:\Windows\System32\wgalogon.dll
    (Where X is your Windows Drive)

And you must also create an empty wglogon.dll file in the same directory from which you are deleting it.

Restart your system once you’re finished. If you are having problems with following these steps, please write in comments.

Snake game created in turbo c++

Here is its source code.

Run this code snake.cpp in Turbo c++ after copying the header file snake.h into the TURBOC3 folder.

u can save these code separately to notepad and change format from .txt to .cpp (for snake.cpp) and .h (for snake.h header file.)

SNAKE.CPP

———

#include<conio.h>
#include<dos.h>
#include<graphics.h>
#include<stdlib.h>
#include<fstream.h>
#include<graphics.h>
#include<stdio.h>
#include<ctype.h>
#include<string.h>
#include”csnake.h”

int rows=25,columns=25;
int cell_size=12;
int board_left,board_top;    //We will put value after graphics mode is initialized
int isfood,foodx,foody,food_score;    //Food variables
int board_width=rows*cell_size,board_height=columns*cell_size,midx,midy;    //Some handy variables
int total_score[2],highest_score=0;
char h_name[20];
int players=2,pcomputer;    //no. of players and is he computer
int end[2]={1,1};        //have the snake ended (2 as 2 snakes)
int speed=7,limit_computer=1;    //speed(inverse), computer skill
int style=1;

const int MAX=6;        //Maximum menu objects

void start_playing();
void default_data(SNAKE[]);
void check_for_end(SNAKE[]);
void putfood(SNAKE[]);
void display_score();
void end_game();
void pause_game();
void move_pcomputer(SNAKE&);
void comment(int);
void writetext(int,int);
int menu();
void skill_menu();
void show_help();
void clearbyline();
void menu_handler();

void main()
{
int d=DETECT,m;
initgraph(&d,&m,”c:\\tc\\bgi”);
randomize();
setbkcolor(0);
midx=getmaxx()/2;
midy=getmaxy()/2;
board_left=midx-board_width/2;
board_top=midy-board_height/2;
start_playing();
}

void start_playing()
{
clearviewport();
showmenu:
int sel=menu();
switch(sel)
{
case 0:
players=1;
break;
case 1:
players=2;
pcomputer=0;
break;
case 2:
players=2;
pcomputer=1;
break;
case 3:
skill_menu();
goto showmenu;
case 4:
setcolor(YELLOW);
settextstyle(6,0,5);
outtextxy(0,10,”Enter (1-classic, 2-modern): “);
char ch=getch();
while(ch!=’1′ && ch!=’2′)
ch=getch();
if(ch==’1′)
{
outtextxy(0,70,”Classic”);
style=0;
}
else
{
outtextxy(0,70,”Modern”);
style=1;
}
ofstream o1(“style.snk”);
o1<<style;
o1.close();
getch();
clearviewport();

goto showmenu;
case 5:
show_help();
goto showmenu;
case 6:
closegraph();
exit(0);
}
SNAKE s[2];
s[0].initialize(style,LIGHTGREEN,GREEN,3,board_left,board_top,cell_size);
if(players==2)
s[1].initialize(style,LIGHTBLUE,BLUE,3,board_left,board_top,cell_size);

default_data(s);

comment(1);    //i.e. press enter to continue
int pressed;
comment(0);
int moved[2];
isfood=0;
while(1)
{
moved[0]=0; moved[1]=0;
putfood(s);
for(int wait=0;wait<10;wait++)
{
delay(speed);
if(kbhit())
{
sound(500);
pressed=getch();
if(pressed==’`’) {nosound();closegraph();exit(0);}
//                if(pressed==’2′) {players=2;pcomputer=0;end[1]=0;snake_size[1]=3;}
if(!moved[0])
{
//right
if(pressed==77)
moved[0]=s[0].setdirection(1);
//left
else if(pressed==75)
moved[0]=s[0].setdirection(3);
//down
else if(pressed==80)
moved[0]=s[0].setdirection(2);    //if has moved then will return
//up
else if(pressed==72)
moved[0]=s[0].setdirection(0);
}
if(pressed==32) pause_game();
pressed=tolower(pressed);
if(players==2&&!pcomputer)
{
if(!moved[1])
{
if(pressed==’d’)
moved[1]=s[1].setdirection(1);
else if(pressed==’a’)
moved[1]=s[1].setdirection(3);
else if(pressed==’s’)
moved[1]=s[1].setdirection(2);
else if(pressed==’w’)
moved[1]=s[1].setdirection(0);
}
}

}
if(pcomputer==1 && !moved[1] && !end[1]) {move_pcomputer(s[1]);moved[1]=1;}
}
nosound();
for(int i=0;i<players;i++)
{
if(s[i].x[0]==foodx && s[i].y[0]==foody)
{
sound(1000);
delay(50);
nosound();
isfood=0;
if(style==0)
{
int cx=board_left+cell_size*foodx+cell_size/2;
int cy=board_top+cell_size*foody+cell_size/2;
setcolor(s[i].color);
circle(cx,cy,cell_size/2-1);
setfillstyle(1,s[i].fillcolor);
floodfill(cx,cy,s[i].color);
}
s[i].size++;
total_score[i]+=food_score;
display_score();
}
if(!end[i])    //player not died
{
s[i].move();
s[i].display();
}
}
check_for_end(s);
if(food_score>1)
food_score–;
}
}

void default_data(SNAKE *s)
{

ifstream h_s(“SCORE.SNK”);
char hh[5];
h_s>>highest_score;
h_s.getline(h_name,20);
h_s.close();

int sel;
ifstream o1(“skill.snk”);
o1>>sel;
o1.close();
switch(sel)
{
case 0:
speed=11; limit_computer=3;
break;
case 1:
speed=9; limit_computer=2;
break;
case 2:
speed=7; limit_computer=1;
break;
case 3:
speed=5; limit_computer=0;
break;
case 4:
speed=3; limit_computer=-1;
}

ifstream o2(“style.snk”);
o2>>style;
o2.close();
isfood=0;
s[1].x[0]=1; s[1].x[1]=1; s[1].x[2]=1;
total_score[0]=0,total_score[1]=0,food_score=0;

setcolor(LIGHTGRAY);
setlinestyle(1,0,1);
rectangle(board_left-1,board_top-1,board_left+board_width+1,board_top+board_height+1);
setlinestyle(0,0,3);
rectangle(board_left-cell_size,board_top-cell_size,board_left+board_width+cell_size,board_top+board_height+cell_size);
setlinestyle(0,0,1);
display_score();
end[0]=0;
if(players==2) end[1]=0;
}

void check_for_end(SNAKE s[])
{
for(int j=0;j<players;j++)
{
if(end[j]) continue;    //if the player has died no need of doing all
int i;
if(players==2)
{
//if one player died now and other has scored more than him end
if(end[0]==1 && total_score[1]>total_score[0]) end_game();
if(end[1]==1 && total_score[0]>total_score[1]) end_game();
}
end[j]=s[j].out_of_boundary(rows,columns);
if(!end[j])
end[j]=s[j].check_bite_itself();
if(end[0] && end[1])
end_game();
}                   //ended loop
}

void putfood(SNAKE s[])
{
static int moves=0;
//    static int l_x,l_y;
if(!isfood)
{
moves=0;
randomm:
foodx=random(rows),foody=rand()%columns;
while(s[0].isat(foodx,foody) || s[1].isat(foodx,foody))
{
foodx=random(rows);
foody=random(columns);
}
isfood=1;
food_score=50;
}
setcolor(RED);
int cx=board_left+foodx*cell_size+cell_size/2;
int cy=board_top+foody*cell_size+cell_size/2;
circle(cx,cy,cell_size/2-1);
setfillstyle(1,RED);
floodfill(cx,cy,getcolor());

moves++;
}

void display_score()
{
setcolor(WHITE);
char t_score[2][5],f_score[5],h_score[5];
itoa(total_score[0],t_score[0],10);
itoa(total_score[1],t_score[1],10);
itoa(highest_score,h_score,10);
//    itoa(food_score,f_score,10);
setviewport(board_left,board_top+board_height+20,board_left+100,board_top+board_height+30,1);
clearviewport();
settextstyle(2,0,4);
outtextxy(0,0,”Player 1:”);
outtextxy(textwidth(“Player 1: “),0,t_score[0]);

setviewport(midx-(textwidth(“Highest:        “)+textwidth(h_name))/2,board_top+board_height+30,midx+(textwidth(“Highest:        “)+textwidth(h_name))/2,board_top+board_height+40,1);
clearviewport();
outtext(“Highest:”);
outtext(h_score);
outtext(” by: “);
outtext(h_name);

if(players!=2) setcolor(getbkcolor());
setviewport(board_left+board_width-60,board_top+board_height+20,board_width+board_left+100-80,board_top+board_height+30,1);
clearviewport();
settextstyle(2,0,4);
outtextxy(0,0,”Player 2:”);
outtextxy(textwidth(“Player 2: “),0,t_score[1]);

setviewport(0,0,639,479,1);
}

void end_game()
{
int pl;

if(players==1) pl=0;
else if(total_score[0]>total_score[1]) pl=1;
else if(total_score[0]<total_score[1] && !pcomputer) pl=2;
else if(total_score[0]<total_score[1] && pcomputer)pl=3;
else pl=4;

setcolor(RED);
static char wwins[5][20]={“GAME OVER!!”,”WINNER! Player 1!!”,”WINNER! Player 2!!”,”WINNER! COMPUTER!!”,”MATCH DRAWN”};

settextstyle(3,0,4);
outtextxy(midx-textwidth(wwins[pl])/2,0,wwins[pl]);

for(int i=0;i<players;i++)
{
if(highest_score<=total_score[i])
{
settextstyle(4,0,4);
setcolor(YELLOW);
static char congrates[50]={“Congratulations!! You got the Highest!!”};

int w=textwidth(congrates);

setviewport(getmaxx()/2-w/2,getmaxy()/2-textheight(“C”)/2,getmaxx()/2+w/2,getmaxy()/2+textheight(“C”),1);
clearviewport();
setviewport(0,0,639,479,1);
outtextxy(getmaxx()/2-w/2,getmaxy()/2-textheight(“C”)/2,congrates);

comment(1);
clearviewport();
gotoxy(1,1);
cout<<“Enter your name: “;
cin>>h_name;
highest_score=total_score[i];
ofstream h_s(“SCORE.SNK”);
h_s<<highest_score<<‘ ‘;
h_s.write(h_name,strlen(h_name));
h_s.close();
}
}
comment(1);
clearbyline();
start_playing();
}

void pause_game()
{
nosound();
comment(2);
}

void move_pcomputer(SNAKE &s)
{
int lim;
lim=limit_computer;
if(s.x[0]<=0 || s.x[0]>=rows-1 || s.y[0]<=0 || s.y[0]>=columns-1) lim=0;

int a=random(3);
int moved=0;
if(a>lim)    //!= so computer can even struck with wall
{
if(foodx>s.x[0])
moved=s.setdirection(1);
if(foodx<s.x[0] && !moved)
moved=s.setdirection(3);
if(foody>s.y[0] && !moved)
moved=s.setdirection(2);
if(foody<s.y[0] && !moved)
moved=s.setdirection(0);
}
}

int menu()
{
static int sel=0;
static char title[10]=”SNAKE”;
writetext(1,sel);
settextstyle(4,0,10);
setcolor(6);
outtextxy(midx-textwidth(title)/2,0,title);
getKey:
settextstyle(4,0,10);
int i=0;
while(!kbhit())
{
i++;
delay(50);
if(i%10!=0) continue;
setcolor(rand()%15+1);
outtextxy(midx-textwidth(title)/2,0,title);
}
int pressed=getch();
switch(pressed)
{
case 13:
break;
case 72:    //FOR UP
if(sel!=0)
{
writetext(0,sel);
sel–;
writetext(1,sel);
}
goto getKey;

case 80:    //FOR DOWN
if(sel!=MAX)
{
writetext(0,sel);
sel++;
writetext(1,sel);
}
goto getKey;

default:
goto getKey;
}
clearbyline();
return sel;
}

void writetext(int color,int sel)
{
static char items[MAX+1][20]={“SINGLE PLAYER”,”DOUBLE PLAYER”,”V/S COMPUTER”,”SKILL”,”STYLE”,”HELP”,”EXIT”};

static int sel_size=7,nor_size=1,space=50,font=3;

settextstyle(font,0,nor_size);
int bot_x=midx-textwidth(items[sel+1])/2;
int bot_y=midy+space+textheight(items[sel+1])/2;
int top_x=midx-textwidth(items[sel-1])/2;
int top_y=midy-space-textheight(items[sel-1])/2;
settextstyle(font,0,sel_size);
int sel_x=midx-textwidth(items[sel])/2;
int sel_y=midy-textheight(items[sel])/2;
int sel_width=textwidth(items[sel]);
//    int sel_height=textheight(items[sel]);

setcolor(getbkcolor());
//WRITING TOP TEXT
if(sel!=0)
{
if(color==1)
setcolor(6);
settextstyle(font,0,nor_size);
outtextxy(top_x,top_y,items[sel-1]);
}
//WRITING SELECTED TEXT
{
if(color==1)
setcolor(BLUE);
settextstyle(font,0,sel_size);
outtextxy(sel_x-3,sel_y-3,items[sel]);
if(color==1)
setcolor(WHITE);
settextstyle(font,0,sel_size);
outtextxy(sel_x,sel_y,items[sel]);
for(int i=42;i<=48;i++)
{

if(color==1)
{
if(i==42||i==48)
setcolor(LIGHTGRAY);
else if(i==43||i==46)
setcolor(WHITE);
else if(i==45)
setcolor(YELLOW);
}
line(0,sel_y+i,sel_x-10,sel_y+i);
line(sel_x+sel_width,sel_y+i,getmaxx(),sel_y+i);
}
}

//WRITING BOTTOM TEXT
if(sel!=MAX)
{
if(color==1)
setcolor(GREEN);
settextstyle(font,0,nor_size);
outtextxy(bot_x,bot_y,items[sel+1]);
}
}

void show_help()
{
clearviewport();
setcolor(WHITE);
settextstyle(3,0,1);
outtextxy(0,0,”Player 1 Keys: UP, DOWN, LEFT, RIGHT”);
outtextxy(0,textheight(“F”),”Player 2 Keys: w, s, a, d (respectively)”);
outtextxy(0,450,”Press any key to continue…….”);
setcolor(6);
outtextxy(0,5*textheight(“F”),”Created By: Himanshu Mishra”);
outtextxy(0,6*textheight(“F”),”Class: XII – E”);
setcolor(GREEN);
outtextxy(0,7*textheight(“F”),”School: The Air Force School, Subroto Park, New Delhi-10, India”);
outtextxy(0,8*textheight(“F”),”Email-ID: himanshu_mishra007@yahoo.co.in”);

getch();
clearviewport();
}

void clearbyline()
{
for(int y=0;y<=midy;y++)
{
delay(1);
sound(400-y);
setcolor(getbkcolor());
line(0,y,getmaxx(),y);
line(0,midy*2-y,getmaxx(),midy*2-y);
}
nosound();
}

void skill_menu()
{
clearviewport();
settextstyle(4,0,10);
setcolor(GREEN);
outtextxy(midx-textwidth(“SKILL”)/2,0,”SKILL”);
static char skills[5][20]={“EASIEST”,”EASY”,”NORMAL”,”HARD”,”HARDEST”};
static int sel=2,last_selected;
ifstream o(“skill.snk”);
o>>sel;
o.close();
last_selected=sel;
settextstyle(3,0,4);
setcolor(6);
for(int i=0;i<5;i++)
{
outtextxy(midx-textwidth(skills[i])/2,200+40*i,skills[i]);
}
setcolor(WHITE);
outtextxy(midx-textwidth(skills[sel])/2,200+40*sel,skills[sel]);
getKey:
int pressed=getch();
switch(pressed)
{
case 27:
sel=last_selected;
break;
case 13:
break;
case 72:    //FOR UP
setcolor(6);
outtextxy(midx-textwidth(skills[sel])/2,200+40*sel,skills[sel]);
sel–;
if(sel<0) sel=4;
setcolor(WHITE);
outtextxy(midx-textwidth(skills[sel])/2,200+40*sel,skills[sel]);
goto getKey;

case 80:    //FOR DOWN
setcolor(6);
outtextxy(midx-textwidth(skills[sel])/2,200+40*sel,skills[sel]);
sel++;
if(sel>4) sel=0;
setcolor(WHITE);
outtextxy(midx-textwidth(skills[sel])/2,200+40*sel,skills[sel]);
goto getKey;
default:
goto getKey;
}
switch(sel)
{
case 0:
speed=11; limit_computer=3;
break;
case 1:
speed=9; limit_computer=2;
break;
case 2:
speed=7; limit_computer=1;
break;
case 3:
speed=5; limit_computer=0;
break;
case 4:
speed=3; limit_computer=-1;
}
ofstream o1(“skill.snk”);
o1<<sel;
o1.close();
clearbyline();
}

void comment(int n)
{
//    static last_n=0;
char comments[5][50]={“”,”Press ENTER to continue…”,”Paused!! Press Space to resume..”};

settextstyle(3,0,3);
setcolor(BROWN);
setviewport(midx-textwidth(comments[n])/2,getmaxy()-textheight(comments[n])-5,midx+textwidth(comments[n])/2,getmaxy()-5,1);
outtext(comments[n]);
int sel;
if(n==1)
{
while(sel!=13)
sel=getch();
}
else if(n==2)
{
sel=getch();
while(sel!=32)
sel=getch();
}
clearviewport();
setviewport(0,0,639,479,1);
}

SNAKE.H

——-

//This header file stores class SNAKE that is used in Menu
class SNAKE
{
void *bbody[2],*bmove[4],*bhead[4],*btail[4];
public:
int x[50],y[50],direction[50],color,fillcolor,size;    //dir-0=up,1=left,2=down,3=right
int style;            //0-classic,1-new
int cell_size;
int offsetx,offsety;        //topx,topy (same thing:-)
//member functions
~SNAKE();            //->DESTRUCTOR
void initialize(int,int,int,int,int,int,int);
void move();
void display();
void reverse();
int getleftdir(int dir);
int gettopdir(int dir);
int setdirection(int dir);
int check_bite_itself();
int out_of_boundary(int,int);
int isat(int,int);
};

void SNAKE::initialize(int u_style,int u_color,int u_fillcolor,int u_size,int u_offsetx,int u_offsety,int u_cell_size)
{
style=u_style;
color=u_color;
fillcolor=u_fillcolor;
size=u_size;
cell_size=u_cell_size;
offsetx=u_offsetx;
offsety=u_offsety;

if(style==1)
{
int rb=cell_size-1,pt1=cell_size/4,pt2=cell_size*3/4; //rb=right-bottom
int center=rb/2;
setcolor(color);
setfillstyle(1,fillcolor);
setviewport(0,0,rb,rb,1);

//Body1 ||
rectangle(pt1,-1,pt2,rb+1);
floodfill(center,center,getcolor());
bbody[0]=malloc(imagesize(0,0,rb,rb));
getimage(0,0,rb,rb,bbody[0]);
clearviewport();

//Body2 ==
rectangle(-1,pt1,rb+1,pt2);
floodfill(center,center,getcolor());
bbody[1]=malloc(imagesize(0,0,rb,rb));
getimage(0,0,rb,rb,bbody[1]);
clearviewport();

//move1 |~
circle(rb+1,rb+1,pt2);
circle(rb+1,rb+1,pt1);
floodfill(center+2,center+1,getcolor());
bmove[0]=malloc(imagesize(0,0,rb,rb));
getimage(0,0,rb,rb,bmove[0]);
clearviewport();

//move2 ~|
circle(0,rb+1,pt2);
circle(0,rb+1,pt1);
floodfill(center-1,center+1,getcolor());
bmove[1]=malloc(imagesize(0,0,rb,rb));
getimage(0,0,rb,rb,bmove[1]);
clearviewport();

//move3 _|
circle(0,0,pt2);
circle(0,0,pt1);
floodfill(center-1,center-1,getcolor());
bmove[2]=malloc(imagesize(0,0,rb,rb));
getimage(0,0,rb,rb,bmove[2]);
clearviewport();

//move4 |_
circle(rb+1,0,pt2);
circle(rb+1,0,pt1);
floodfill(center+1,center-1,getcolor());
bmove[3]=malloc(imagesize(0,0,rb,rb));
getimage(0,0,rb,rb,bmove[3]);
clearviewport();

//head 1    (~)
sector(cell_size/2,cell_size,0,180,cell_size/4,cell_size/2);
putpixel(cell_size/2+2,cell_size/2+4,0);
putpixel(cell_size/2-2,cell_size/2+4,0);
bhead[0]=malloc(imagesize(0,0,rb,rb));
getimage(0,0,rb,rb,bhead[0]);
clearviewport();

//head 2    ==*
fillellipse(0,cell_size/2,cell_size/2,cell_size/4);
putpixel(cell_size/2-4,cell_size/2+2,0);
putpixel(cell_size/2-4,cell_size/2-2,0);
bhead[1]=malloc(imagesize(0,0,rb,rb));
getimage(0,0,rb,rb,bhead[1]);
clearviewport();

//head 3    (_)
fillellipse(cell_size/2,0,cell_size/4,cell_size/2);
putpixel(cell_size/2+2,cell_size/2-4,0);
putpixel(cell_size/2-2,cell_size/2-4,0);
bhead[2]=malloc(imagesize(0,0,rb,rb));
getimage(0,0,rb,rb,bhead[2]);
clearviewport();

//head 4    *==
sector(cell_size,cell_size/2,90,270,cell_size/2,cell_size/4);
putpixel(cell_size/2+4,cell_size/2+2,0);
putpixel(cell_size/2+4,cell_size/2-2,0);
bhead[3]=malloc(imagesize(0,0,rb,rb));
getimage(0,0,rb,rb,bhead[3]);
clearviewport();

//tail1        \/
fillellipse(cell_size/2,0,cell_size/4,cell_size);
btail[0]=malloc(imagesize(0,0,rb,rb));
getimage(0,0,rb,rb,btail[0]);
clearviewport();

//tail2        <
fillellipse(cell_size,cell_size/2,cell_size,cell_size/4);
btail[1]=malloc(imagesize(0,0,rb,rb));
getimage(0,0,rb,rb,btail[1]);
clearviewport();

//tail3        /\
fillellipse(cell_size/2,cell_size,cell_size/4,cell_size);
btail[2]=malloc(imagesize(0,0,rb,rb));
getimage(0,0,rb,rb,btail[2]);
clearviewport();

//tail4        >
fillellipse(0,cell_size/2,cell_size,cell_size/4);
btail[3]=malloc(imagesize(0,0,rb,rb));
getimage(0,0,rb,rb,btail[3]);
clearviewport();

setviewport(0,0,639,479,1);
}
for(int i=0;i<size;i++)
{
x[i]=0;
y[i]=size-i-1;
direction[i]=2;
move();
//        display();
}
}

SNAKE::~SNAKE()            //Destructor
{
if(style==1)
{
for(int i=0;i<4;i++)
{
if(i<2)
free(bbody[i]);
free(bmove[i]);
free(bhead[i]);
free(btail[i]);
}
}
}

void SNAKE::move()
{
for(int i=size+1;i>0;i–)
{
x[i]=x[i-1];
y[i]=y[i-1];
}

if(direction[0]==0) y[0]–;
else if(direction[0]==1) x[0]++;
else if(direction[0]==2) y[0]++;
else if(direction[0]==3) x[0]–;
}

void SNAKE::display()
{
//To delete the last cell
{
setviewport(offsetx+cell_size*x[size],offsety+cell_size*y[size],offsetx+cell_size*(x[size]+1),offsety+cell_size*(y[size]+1),1);
clearviewport();
setviewport(0,0,639,479,1);
}
int cx,cy;

if(style==0)        //classic
{
cx=offsetx+cell_size*x[0]+cell_size/2;
cy=offsety+cell_size*y[0]+cell_size/2;

setcolor(color);
circle(cx,cy,cell_size/2-1);
setfillstyle(1,fillcolor);
floodfill(cx,cy,color);
}
else if(style==1)
{
cx=offsetx+cell_size*x[size-1];
cy=offsety+cell_size*y[size-1];
putimage(cx,cy,btail[direction[size-2]],COPY_PUT);

cx=offsetx+cell_size*x[0];
cy=offsety+cell_size*y[0];
putimage(cx,cy,bhead[direction[0]],COPY_PUT);

cx=offsetx+cell_size*x[1];
cy=offsety+cell_size*y[1];

if((direction[1]==0 && direction[0]==1) || (direction[1]==3 & direction[0]==2))
putimage(cx,cy,bmove[0],COPY_PUT);
else if((direction[1]==0 && direction[0]==3) || (direction[1]==1 && direction[0]==2))
putimage(cx,cy,bmove[1],COPY_PUT);
else if((direction[1]==1 && direction[0]==0) || (direction[1]==2 && direction[0]==3))
putimage(cx,cy,bmove[2],COPY_PUT);
else if((direction[1]==2 && direction[0]==1) || (direction[1]==3 && direction[0]==0))
putimage(cx,cy,bmove[3],COPY_PUT);
else if(getleftdir(direction[1])!=0 && getleftdir(direction[0])!=0)
putimage(cx,cy,bbody[1],COPY_PUT);
else    putimage(cx,cy,bbody[0],COPY_PUT);
}

//no further use can be changed
for(int i=size;i>0;i–)
direction[i]=direction[i-1];
}

void SNAKE::reverse()
{
for(int i=0;i<size;i++)
{
x[i]=x[i+1];
y[i]=y[i+1];
direction[i]=direction[i+1];
}
}

int SNAKE::getleftdir(int dir)
{
if(dir==1) return 1;
else if(dir==3) return -1;
else return 0;
}
int SNAKE::gettopdir(int dir)
{
if(dir==0) return -1;
else if(dir==2) return 1;
else return 0;
}
int SNAKE::setdirection(int dir)
{
int moved=1;
if(dir==1 && direction[1]!=3) direction[0]=1;
else if(dir==2 && direction[1]!=0) direction[0]=2;
else if(dir==3 && direction[1]!=1) direction[0]=3;
else if(dir==0 && direction[1]!=2) direction[0]=0;
else moved=0;

return moved;
}

int SNAKE::check_bite_itself()
{
for(int i=1;i<size;i++)
if(x[0]==x[i] && y[0]==y[i])
return 1;
return 0;
}

int SNAKE::out_of_boundary(int max_row,int max_column)
{
if(x[0]<0 || y[0]<0 || x[0]>=max_row || y[0]>=max_column)
return 1;
return 0;    //no need for else
}

int SNAKE::isat(int row,int column)
{
for(int i=0;i<size;i++)
if(x[i]==row && y[i]==column)
return 1;
return 0;
}
/************************************************************/
/************************************************************/

If u hav not heard of CON folder,, try creating a folder named “con” in windows.

u cant create it directly…

bcos CON is the name assigned for windows configuration folder by microsoft.

n similarly named folders can create confusion 4 th os. so creating folder named “con” is impossible.

although u can create it using the method below, the folder is useless, u cant use it nor delete it.

Follow these steps to create CON folder :-

——————————–

STEP1: goto command prompt

STEP2: and type md \\.\\”c:\con” (with quotes, better you copy and past it)

the above command will create the folder named “con” in Drive C:

To create that folder in your desktop (for Windows XP) replace the ‘c:\con’ with the FULL PATH of your Desktop, Below is an Example:

md \\.\\”C:\Documents and Settings\USER\Desktop\con” (Where USER is your USERNAME)

(You MUST specify the full path within double quotes [“] If it contains spaces)

In Windows 98, your Desktop path would be : C:\windoiws\Desktop (where C: is the drive letter if your Windows installation)

That is all about creating the folder.

BUT DON’T STOP HERE
Because after creating such a folder, you can’t delete it by simply pressing the DEL key.
To delete this kind of folder, use the same command replacing MD with RD. For example:

rd \\.\\”c:\con” (with quotes for path containing spaces)

BUT DID YOU KNOW?, there are also some other names which you cannot use for a folder. For exapmle Try to create a folder with these names:
AUX, COM1, COM2, COM3, COM4, LPT1, LPT2, LPT3, PRN, NUL

more info can be found here–> http://kerneltrap.org/node/5772

======================================…
NOTE: PLEASE BE CAREFUL WHEN MAKING ANY FOLDER USING ABOVE NAMES, AS THEY MIGHT CREATE SOME PROBLEMS IN WINDOWS

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!