<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Tech Guru 08</title>
	<atom:link href="http://techguru08.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://techguru08.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Fri, 25 Apr 2008 08:40:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='techguru08.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Tech Guru 08</title>
		<link>http://techguru08.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://techguru08.wordpress.com/osd.xml" title="Tech Guru 08" />
	<atom:link rel='hub' href='http://techguru08.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Installing Windows XP Over Windows Vista Without Losing Windows Vista</title>
		<link>http://techguru08.wordpress.com/2008/04/25/installing-windows-xp-over-windows-vista-without-losing-windows-vista/</link>
		<comments>http://techguru08.wordpress.com/2008/04/25/installing-windows-xp-over-windows-vista-without-losing-windows-vista/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 08:40:16 +0000</pubDate>
		<dc:creator>techguru08</dc:creator>
				<category><![CDATA[windows tricks]]></category>

		<guid isPermaLink="false">http://techguru08.wordpress.com/?p=6</guid>
		<description><![CDATA[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 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techguru08.wordpress.com&amp;blog=3575138&amp;post=6&amp;subd=techguru08&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>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</p>
<p>Simply boot from WinXP CD and install XP on any partition other than partition where you have installed WinVista</p>
<p>After installation you will have no boot prompt to run WinVista.</p>
<p>Download and install <a href="http://neosmart.net/dl.php?id=1" target="_blank">EasyBCD</a></p>
<p>Run it you will get this error. Click Yes</p>
<p><a title="1.jpg" href="http://technodigits.files.wordpress.com/2008/01/1.jpg"><img style="width:545px;height:128px;" src="http://technodigits.files.wordpress.com/2008/01/1.jpg?w=557&#038;h=130" alt="1.jpg" width="557" height="130" /></a></p>
<p>Now Select C Drive (this is the active or boot drive)</p>
<p><a title="2.jpg" href="http://technodigits.files.wordpress.com/2008/01/2.jpg"><img src="http://technodigits.files.wordpress.com/2008/01/2.jpg?w=459&#038;h=210" alt="2.jpg" width="459" height="210" /></a></p>
<p>Select the Drive where WinVista was installed mine D:\</p>
<p><a title="3.jpg" href="http://technodigits.files.wordpress.com/2008/01/3.jpg"><img src="http://technodigits.files.wordpress.com/2008/01/3.jpg?w=458&#038;h=206" alt="3.jpg" width="458" height="206" /></a></p>
<p>You will see this message. Click <strong>OK</strong></p>
<p><a title="4.jpg" href="http://technodigits.files.wordpress.com/2008/01/4.jpg"><img src="http://technodigits.files.wordpress.com/2008/01/4.jpg?w=510" alt="Installing Windows XP Over Windows Vista Without Losing Windows Vista" /></a></p>
<p>You will see the following box</p>
<p><a title="5.jpg" href="http://technodigits.files.wordpress.com/2008/01/5.jpg"><img style="width:497px;height:434px;" src="http://technodigits.files.wordpress.com/2008/01/5.jpg?w=527&#038;h=450" alt="5.jpg" width="527" height="450" /></a></p>
<p>Go to <strong>Add/Remove Entries</strong> Section. You will need to enter the Details where XP is installed. Select <strong>Windows NT/2k/XP/2k3</strong> in <strong>Type:</strong> box and in the <strong>Name:</strong> Type <strong>Windows XP</strong>, Now in the <strong>Drive</strong> box select the Drive where you have installed XP recently. Then Click <strong>Add Entry</strong> and then <strong>Save</strong>. You can also Select which Entry should be <strong>Up</strong> and which should be <strong>Down</strong></p>
<p><a title="6.jpg" href="http://technodigits.files.wordpress.com/2008/01/6.jpg"><img src="http://technodigits.files.wordpress.com/2008/01/6.jpg?w=502&#038;h=420" alt="6.jpg" width="502" height="420" /></a></p>
<p>After adding WinXP boot entry Go to <strong>Change Settings</strong> Section and Select which OS should be default and alos enter 30 as the <strong>Bootloader Timeout:</strong> , Now <strong>Save Settings</strong>.</p>
<p><a title="8.jpg" href="http://technodigits.files.wordpress.com/2008/01/8.jpg"><img style="width:507px;height:434px;" src="http://technodigits.files.wordpress.com/2008/01/8.jpg?w=503&#038;h=445" alt="8.jpg" width="503" height="445" /></a></p>
<p>And you are done! Better luck</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/techguru08.wordpress.com/6/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/techguru08.wordpress.com/6/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techguru08.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techguru08.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techguru08.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techguru08.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techguru08.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techguru08.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techguru08.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techguru08.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techguru08.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techguru08.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techguru08.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techguru08.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techguru08.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techguru08.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techguru08.wordpress.com&amp;blog=3575138&amp;post=6&amp;subd=techguru08&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techguru08.wordpress.com/2008/04/25/installing-windows-xp-over-windows-vista-without-losing-windows-vista/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/629364e97bc4fddd5ac73245f5573fee?s=96&#38;d=identicon" medium="image">
			<media:title type="html">techguru08</media:title>
		</media:content>

		<media:content url="http://technodigits.files.wordpress.com/2008/01/1.jpg" medium="image">
			<media:title type="html">1.jpg</media:title>
		</media:content>

		<media:content url="http://technodigits.files.wordpress.com/2008/01/2.jpg" medium="image">
			<media:title type="html">2.jpg</media:title>
		</media:content>

		<media:content url="http://technodigits.files.wordpress.com/2008/01/3.jpg" medium="image">
			<media:title type="html">3.jpg</media:title>
		</media:content>

		<media:content url="http://technodigits.files.wordpress.com/2008/01/4.jpg" medium="image">
			<media:title type="html">Installing Windows XP Over Windows Vista Without Losing Windows Vista</media:title>
		</media:content>

		<media:content url="http://technodigits.files.wordpress.com/2008/01/5.jpg" medium="image">
			<media:title type="html">5.jpg</media:title>
		</media:content>

		<media:content url="http://technodigits.files.wordpress.com/2008/01/6.jpg" medium="image">
			<media:title type="html">6.jpg</media:title>
		</media:content>

		<media:content url="http://technodigits.files.wordpress.com/2008/01/8.jpg" medium="image">
			<media:title type="html">8.jpg</media:title>
		</media:content>
	</item>
		<item>
		<title>How To Remove Windows Genuine Advantage Notification (WGA)</title>
		<link>http://techguru08.wordpress.com/2008/04/25/how-to-remove-windows-genuine-advantage-notification-wga/</link>
		<comments>http://techguru08.wordpress.com/2008/04/25/how-to-remove-windows-genuine-advantage-notification-wga/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 08:34:50 +0000</pubDate>
		<dc:creator>techguru08</dc:creator>
				<category><![CDATA[windows tricks]]></category>

		<guid isPermaLink="false">http://techguru08.wordpress.com/?p=5</guid>
		<description><![CDATA[What is Windows Genuine Advantage Notification? 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 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techguru08.wordpress.com&amp;blog=3575138&amp;post=5&amp;subd=techguru08&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3><strong>What is Windows Genuine Advantage Notification?</strong></h3>
<p><a href="http://technize.com/wp-content/uploads/2008/03/wga-logo.png"><img style="border:0 none;" src="http://technize.com/wp-content/uploads/2008/03/wga-logo-thumb.png" border="0" alt="WGA_Logo" width="142" height="84" align="right" /></a> 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.</p>
<h3><strong>What does it do?</strong></h3>
<p>If, for some reason, this tool fails to</p>
<p>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.</p>
<p><a href="http://support.microsoft.com/kb/905474/" target="_blank">Here</a> is the description of Windows Genuine Advantage Tool from Microsoft.</p>
<p>When this tool is installed, it shows up before logging on to the system</p>
<p><a href="http://technize.com/wp-content/uploads/2008/03/wgalogon.jpg"><img style="border:0 none;" src="http://technize.com/wp-content/uploads/2008/03/wgalogon-thumb.jpg" border="0" alt="wgalogon" width="244" height="154" /></a></p>
<p>And keeps on displaying the balloons in the status bar.</p>
<p>Windows Vista</p>
<p><a href="http://technize.com/wp-content/uploads/2008/03/wgavistanotify.png"><img style="border:0 none;" src="http://technize.com/wp-content/uploads/2008/03/wgavistanotify-thumb.png" border="0" alt="wgavistanotify" width="184" height="97" /></a></p>
<p>Windows XP</p>
<p><a href="http://technize.com/wp-content/uploads/2008/03/wgaxpnotify.png"><img style="border:0 none;" src="http://technize.com/wp-content/uploads/2008/03/wgaxpnotify-thumb.png" border="0" alt="wgaxpnotify" width="184" height="55" /></a></p>
<h3><strong>What data does WGA collect?</strong></h3>
<p>This tool, if installed, collects the following data from the system.</p>
<ul>
<li>Computer make and model</li>
<li>BIOS checksum.</li>
<li>MAC address.</li>
<li>GUID</li>
<li>Hard drive serial number.</li>
<li>Region and language settings of the operating system.</li>
<li>Operating system version.</li>
<li>PC BIOS information (make, version, date).</li>
<li>PC manufacturer.</li>
<li>User locale setting.</li>
<li>Validation and installation results.</li>
<li>Windows or Office product key.</li>
<li>Windows XP product ID.</li>
</ul>
<h3>How to remove WGA notification:</h3>
<p>There are several ways to disable WGA notification. Some of them are given below:</p>
<h4><strong>1- Through Firewall</strong></h4>
<p>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.</p>
<h4><strong>2- Through third party softwares</strong></h4>
<p>There are many softwares available which can disable WGA notifications. Notable softwares include WGARemover and <a href="http://www.p2plife.com/forums/Official_muBlinder_Page-t320.html" target="_blank">MUBlinder</a>.</p>
<h4><strong>3- Through System Restore</strong></h4>
<p>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.</p>
<h4><strong>4- Through deleting files manually</strong></h4>
<p>To remove WGA manually, follow the steps below:</p>
<ul>
<li><a href="http://technize.com/content/downloads/wgakill.bat" target="_blank">Download this bat file</a></li>
<li>Double click it and restart your system</li>
<li>Most probably, you have successfully deleted all the files used by WGA. Now it should not come at logon.</li>
</ul>
<p>If this bat file does not work, you should manually delete the following files from your system:</p>
<ul>
<li>X:\Windows\System32\wgatray.exe</li>
<li>X:\Windows\System32\wgalogon.dll<br />
(Where X is your Windows Drive)</li>
</ul>
<p>And you must also create an empty wglogon.dll file in the same directory from which you are deleting it.</p>
<p>Restart your system once you’re finished. If you are having problems with following these steps, please write in comments.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/techguru08.wordpress.com/5/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/techguru08.wordpress.com/5/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techguru08.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techguru08.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techguru08.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techguru08.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techguru08.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techguru08.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techguru08.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techguru08.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techguru08.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techguru08.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techguru08.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techguru08.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techguru08.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techguru08.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techguru08.wordpress.com&amp;blog=3575138&amp;post=5&amp;subd=techguru08&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techguru08.wordpress.com/2008/04/25/how-to-remove-windows-genuine-advantage-notification-wga/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/629364e97bc4fddd5ac73245f5573fee?s=96&#38;d=identicon" medium="image">
			<media:title type="html">techguru08</media:title>
		</media:content>

		<media:content url="http://technize.com/wp-content/uploads/2008/03/wga-logo-thumb.png" medium="image">
			<media:title type="html">WGA_Logo</media:title>
		</media:content>

		<media:content url="http://technize.com/wp-content/uploads/2008/03/wgalogon-thumb.jpg" medium="image">
			<media:title type="html">wgalogon</media:title>
		</media:content>

		<media:content url="http://technize.com/wp-content/uploads/2008/03/wgavistanotify-thumb.png" medium="image">
			<media:title type="html">wgavistanotify</media:title>
		</media:content>

		<media:content url="http://technize.com/wp-content/uploads/2008/03/wgaxpnotify-thumb.png" medium="image">
			<media:title type="html">wgaxpnotify</media:title>
		</media:content>
	</item>
		<item>
		<title>Snake Game in Cpp</title>
		<link>http://techguru08.wordpress.com/2008/04/25/snake-game-in-cpp/</link>
		<comments>http://techguru08.wordpress.com/2008/04/25/snake-game-in-cpp/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 08:31:45 +0000</pubDate>
		<dc:creator>techguru08</dc:creator>
				<category><![CDATA[c++]]></category>

		<guid isPermaLink="false">http://techguru08.wordpress.com/?p=4</guid>
		<description><![CDATA[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 &#8212;&#8212;&#8212; #include&#60;conio.h&#62; #include&#60;dos.h&#62; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techguru08.wordpress.com&amp;blog=3575138&amp;post=4&amp;subd=techguru08&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Snake game created in turbo c++</p>
<p>Here is its source code.</p>
<p>Run this code snake.cpp in Turbo c++ after copying the header file snake.h into the TURBOC3 folder.</p>
<p>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.)</p>
<p><strong>SNAKE.CPP</strong></p>
<p>&#8212;&#8212;&#8212;</p>
<p>#include&lt;conio.h&gt;<br />
#include&lt;dos.h&gt;<br />
#include&lt;graphics.h&gt;<br />
#include&lt;stdlib.h&gt;<br />
#include&lt;fstream.h&gt;<br />
#include&lt;graphics.h&gt;<br />
#include&lt;stdio.h&gt;<br />
#include&lt;ctype.h&gt;<br />
#include&lt;string.h&gt;<br />
#include&#8221;csnake.h&#8221;</p>
<p>int rows=25,columns=25;<br />
int cell_size=12;<br />
int board_left,board_top;    //We will put value after graphics mode is initialized<br />
int isfood,foodx,foody,food_score;    //Food variables<br />
int board_width=rows*cell_size,board_height=columns*cell_size,midx,midy;    //Some handy variables<br />
int total_score[2],highest_score=0;<br />
char h_name[20];<br />
int players=2,pcomputer;    //no. of players and is he computer<br />
int end[2]={1,1};        //have the snake ended (2 as 2 snakes)<br />
int speed=7,limit_computer=1;    //speed(inverse), computer skill<br />
int style=1;</p>
<p>const int MAX=6;        //Maximum menu objects</p>
<p>void start_playing();<br />
void default_data(SNAKE[]);<br />
void check_for_end(SNAKE[]);<br />
void putfood(SNAKE[]);<br />
void display_score();<br />
void end_game();<br />
void pause_game();<br />
void move_pcomputer(SNAKE&amp;);<br />
void comment(int);<br />
void writetext(int,int);<br />
int menu();<br />
void skill_menu();<br />
void show_help();<br />
void clearbyline();<br />
void menu_handler();</p>
<p>void main()<br />
{<br />
int d=DETECT,m;<br />
initgraph(&amp;d,&amp;m,&#8221;c:\\tc\\bgi&#8221;);<br />
randomize();<br />
setbkcolor(0);<br />
midx=getmaxx()/2;<br />
midy=getmaxy()/2;<br />
board_left=midx-board_width/2;<br />
board_top=midy-board_height/2;<br />
start_playing();<br />
}</p>
<p>void start_playing()<br />
{<br />
clearviewport();<br />
showmenu:<br />
int sel=menu();<br />
switch(sel)<br />
{<br />
case 0:<br />
players=1;<br />
break;<br />
case 1:<br />
players=2;<br />
pcomputer=0;<br />
break;<br />
case 2:<br />
players=2;<br />
pcomputer=1;<br />
break;<br />
case 3:<br />
skill_menu();<br />
goto showmenu;<br />
case 4:<br />
setcolor(YELLOW);<br />
settextstyle(6,0,5);<br />
outtextxy(0,10,&#8221;Enter (1-classic, 2-modern): &#8220;);<br />
char ch=getch();<br />
while(ch!=&#8217;1&#8242; &amp;&amp; ch!=&#8217;2&#8242;)<br />
ch=getch();<br />
if(ch==&#8217;1&#8242;)<br />
{<br />
outtextxy(0,70,&#8221;Classic&#8221;);<br />
style=0;<br />
}<br />
else<br />
{<br />
outtextxy(0,70,&#8221;Modern&#8221;);<br />
style=1;<br />
}<br />
ofstream o1(&#8220;style.snk&#8221;);<br />
o1&lt;&lt;style;<br />
o1.close();<br />
getch();<br />
clearviewport();</p>
<p>goto showmenu;<br />
case 5:<br />
show_help();<br />
goto showmenu;<br />
case 6:<br />
closegraph();<br />
exit(0);<br />
}<br />
SNAKE s[2];<br />
s[0].initialize(style,LIGHTGREEN,GREEN,3,board_left,board_top,cell_size);<br />
if(players==2)<br />
s[1].initialize(style,LIGHTBLUE,BLUE,3,board_left,board_top,cell_size);</p>
<p>default_data(s);</p>
<p>comment(1);    //i.e. press enter to continue<br />
int pressed;<br />
comment(0);<br />
int moved[2];<br />
isfood=0;<br />
while(1)<br />
{<br />
moved[0]=0; moved[1]=0;<br />
putfood(s);<br />
for(int wait=0;wait&lt;10;wait++)<br />
{<br />
delay(speed);<br />
if(kbhit())<br />
{<br />
sound(500);<br />
pressed=getch();<br />
if(pressed==&#8217;`') {nosound();closegraph();exit(0);}<br />
//                if(pressed==&#8217;2&#8242;) {players=2;pcomputer=0;end[1]=0;snake_size[1]=3;}<br />
if(!moved[0])<br />
{<br />
//right<br />
if(pressed==77)<br />
moved[0]=s[0].setdirection(1);<br />
//left<br />
else if(pressed==75)<br />
moved[0]=s[0].setdirection(3);<br />
//down<br />
else if(pressed==80)<br />
moved[0]=s[0].setdirection(2);    //if has moved then will return<br />
//up<br />
else if(pressed==72)<br />
moved[0]=s[0].setdirection(0);<br />
}<br />
if(pressed==32) pause_game();<br />
pressed=tolower(pressed);<br />
if(players==2&amp;&amp;!pcomputer)<br />
{<br />
if(!moved[1])<br />
{<br />
if(pressed==&#8217;d')<br />
moved[1]=s[1].setdirection(1);<br />
else if(pressed==&#8217;a')<br />
moved[1]=s[1].setdirection(3);<br />
else if(pressed==&#8217;s')<br />
moved[1]=s[1].setdirection(2);<br />
else if(pressed==&#8217;w')<br />
moved[1]=s[1].setdirection(0);<br />
}<br />
}</p>
<p>}<br />
if(pcomputer==1 &amp;&amp; !moved[1] &amp;&amp; !end[1]) {move_pcomputer(s[1]);moved[1]=1;}<br />
}<br />
nosound();<br />
for(int i=0;i&lt;players;i++)<br />
{<br />
if(s[i].x[0]==foodx &amp;&amp; s[i].y[0]==foody)<br />
{<br />
sound(1000);<br />
delay(50);<br />
nosound();<br />
isfood=0;<br />
if(style==0)<br />
{<br />
int cx=board_left+cell_size*foodx+cell_size/2;<br />
int cy=board_top+cell_size*foody+cell_size/2;<br />
setcolor(s[i].color);<br />
circle(cx,cy,cell_size/2-1);<br />
setfillstyle(1,s[i].fillcolor);<br />
floodfill(cx,cy,s[i].color);<br />
}<br />
s[i].size++;<br />
total_score[i]+=food_score;<br />
display_score();<br />
}<br />
if(!end[i])    //player not died<br />
{<br />
s[i].move();<br />
s[i].display();<br />
}<br />
}<br />
check_for_end(s);<br />
if(food_score&gt;1)<br />
food_score&#8211;;<br />
}<br />
}</p>
<p>void default_data(SNAKE *s)<br />
{</p>
<p>ifstream h_s(&#8220;SCORE.SNK&#8221;);<br />
char hh[5];<br />
h_s&gt;&gt;highest_score;<br />
h_s.getline(h_name,20);<br />
h_s.close();</p>
<p>int sel;<br />
ifstream o1(&#8220;skill.snk&#8221;);<br />
o1&gt;&gt;sel;<br />
o1.close();<br />
switch(sel)<br />
{<br />
case 0:<br />
speed=11; limit_computer=3;<br />
break;<br />
case 1:<br />
speed=9; limit_computer=2;<br />
break;<br />
case 2:<br />
speed=7; limit_computer=1;<br />
break;<br />
case 3:<br />
speed=5; limit_computer=0;<br />
break;<br />
case 4:<br />
speed=3; limit_computer=-1;<br />
}</p>
<p>ifstream o2(&#8220;style.snk&#8221;);<br />
o2&gt;&gt;style;<br />
o2.close();<br />
isfood=0;<br />
s[1].x[0]=1; s[1].x[1]=1; s[1].x[2]=1;<br />
total_score[0]=0,total_score[1]=0,food_score=0;</p>
<p>setcolor(LIGHTGRAY);<br />
setlinestyle(1,0,1);<br />
rectangle(board_left-1,board_top-1,board_left+board_width+1,board_top+board_height+1);<br />
setlinestyle(0,0,3);<br />
rectangle(board_left-cell_size,board_top-cell_size,board_left+board_width+cell_size,board_top+board_height+cell_size);<br />
setlinestyle(0,0,1);<br />
display_score();<br />
end[0]=0;<br />
if(players==2) end[1]=0;<br />
}</p>
<p>void check_for_end(SNAKE s[])<br />
{<br />
for(int j=0;j&lt;players;j++)<br />
{<br />
if(end[j]) continue;    //if the player has died no need of doing all<br />
int i;<br />
if(players==2)<br />
{<br />
//if one player died now and other has scored more than him end<br />
if(end[0]==1 &amp;&amp; total_score[1]&gt;total_score[0]) end_game();<br />
if(end[1]==1 &amp;&amp; total_score[0]&gt;total_score[1]) end_game();<br />
}<br />
end[j]=s[j].out_of_boundary(rows,columns);<br />
if(!end[j])<br />
end[j]=s[j].check_bite_itself();<br />
if(end[0] &amp;&amp; end[1])<br />
end_game();<br />
}                   //ended loop<br />
}</p>
<p>void putfood(SNAKE s[])<br />
{<br />
static int moves=0;<br />
//    static int l_x,l_y;<br />
if(!isfood)<br />
{<br />
moves=0;<br />
randomm:<br />
foodx=random(rows),foody=rand()%columns;<br />
while(s[0].isat(foodx,foody) || s[1].isat(foodx,foody))<br />
{<br />
foodx=random(rows);<br />
foody=random(columns);<br />
}<br />
isfood=1;<br />
food_score=50;<br />
}<br />
setcolor(RED);<br />
int cx=board_left+foodx*cell_size+cell_size/2;<br />
int cy=board_top+foody*cell_size+cell_size/2;<br />
circle(cx,cy,cell_size/2-1);<br />
setfillstyle(1,RED);<br />
floodfill(cx,cy,getcolor());</p>
<p>moves++;<br />
}</p>
<p>void display_score()<br />
{<br />
setcolor(WHITE);<br />
char t_score[2][5],f_score[5],h_score[5];<br />
itoa(total_score[0],t_score[0],10);<br />
itoa(total_score[1],t_score[1],10);<br />
itoa(highest_score,h_score,10);<br />
//    itoa(food_score,f_score,10);<br />
setviewport(board_left,board_top+board_height+20,board_left+100,board_top+board_height+30,1);<br />
clearviewport();<br />
settextstyle(2,0,4);<br />
outtextxy(0,0,&#8221;Player 1:&#8221;);<br />
outtextxy(textwidth(&#8220;Player 1: &#8220;),0,t_score[0]);</p>
<p>setviewport(midx-(textwidth(&#8220;Highest:        &#8220;)+textwidth(h_name))/2,board_top+board_height+30,midx+(textwidth(&#8220;Highest:        &#8220;)+textwidth(h_name))/2,board_top+board_height+40,1);<br />
clearviewport();<br />
outtext(&#8220;Highest:&#8221;);<br />
outtext(h_score);<br />
outtext(&#8221; by: &#8220;);<br />
outtext(h_name);</p>
<p>if(players!=2) setcolor(getbkcolor());<br />
setviewport(board_left+board_width-60,board_top+board_height+20,board_width+board_left+100-80,board_top+board_height+30,1);<br />
clearviewport();<br />
settextstyle(2,0,4);<br />
outtextxy(0,0,&#8221;Player 2:&#8221;);<br />
outtextxy(textwidth(&#8220;Player 2: &#8220;),0,t_score[1]);</p>
<p>setviewport(0,0,639,479,1);<br />
}</p>
<p>void end_game()<br />
{<br />
int pl;</p>
<p>if(players==1) pl=0;<br />
else if(total_score[0]&gt;total_score[1]) pl=1;<br />
else if(total_score[0]&lt;total_score[1] &amp;&amp; !pcomputer) pl=2;<br />
else if(total_score[0]&lt;total_score[1] &amp;&amp; pcomputer)pl=3;<br />
else pl=4;</p>
<p>setcolor(RED);<br />
static char wwins[5][20]={&#8220;GAME OVER!!&#8221;,&#8221;WINNER! Player 1!!&#8221;,&#8221;WINNER! Player 2!!&#8221;,&#8221;WINNER! COMPUTER!!&#8221;,&#8221;MATCH DRAWN&#8221;};</p>
<p>settextstyle(3,0,4);<br />
outtextxy(midx-textwidth(wwins[pl])/2,0,wwins[pl]);</p>
<p>for(int i=0;i&lt;players;i++)<br />
{<br />
if(highest_score&lt;=total_score[i])<br />
{<br />
settextstyle(4,0,4);<br />
setcolor(YELLOW);<br />
static char congrates[50]={&#8220;Congratulations!! You got the Highest!!&#8221;};</p>
<p>int w=textwidth(congrates);</p>
<p>setviewport(getmaxx()/2-w/2,getmaxy()/2-textheight(&#8220;C&#8221;)/2,getmaxx()/2+w/2,getmaxy()/2+textheight(&#8220;C&#8221;),1);<br />
clearviewport();<br />
setviewport(0,0,639,479,1);<br />
outtextxy(getmaxx()/2-w/2,getmaxy()/2-textheight(&#8220;C&#8221;)/2,congrates);</p>
<p>comment(1);<br />
clearviewport();<br />
gotoxy(1,1);<br />
cout&lt;&lt;&#8221;Enter your name: &#8220;;<br />
cin&gt;&gt;h_name;<br />
highest_score=total_score[i];<br />
ofstream h_s(&#8220;SCORE.SNK&#8221;);<br />
h_s&lt;&lt;highest_score&lt;&lt;&#8217; &#8216;;<br />
h_s.write(h_name,strlen(h_name));<br />
h_s.close();<br />
}<br />
}<br />
comment(1);<br />
clearbyline();<br />
start_playing();<br />
}</p>
<p>void pause_game()<br />
{<br />
nosound();<br />
comment(2);<br />
}</p>
<p>void move_pcomputer(SNAKE &amp;s)<br />
{<br />
int lim;<br />
lim=limit_computer;<br />
if(s.x[0]&lt;=0 || s.x[0]&gt;=rows-1 || s.y[0]&lt;=0 || s.y[0]&gt;=columns-1) lim=0;</p>
<p>int a=random(3);<br />
int moved=0;<br />
if(a&gt;lim)    //!= so computer can even struck with wall<br />
{<br />
if(foodx&gt;s.x[0])<br />
moved=s.setdirection(1);<br />
if(foodx&lt;s.x[0] &amp;&amp; !moved)<br />
moved=s.setdirection(3);<br />
if(foody&gt;s.y[0] &amp;&amp; !moved)<br />
moved=s.setdirection(2);<br />
if(foody&lt;s.y[0] &amp;&amp; !moved)<br />
moved=s.setdirection(0);<br />
}<br />
}</p>
<p>int menu()<br />
{<br />
static int sel=0;<br />
static char title[10]=&#8221;SNAKE&#8221;;<br />
writetext(1,sel);<br />
settextstyle(4,0,10);<br />
setcolor(6);<br />
outtextxy(midx-textwidth(title)/2,0,title);<br />
getKey:<br />
settextstyle(4,0,10);<br />
int i=0;<br />
while(!kbhit())<br />
{<br />
i++;<br />
delay(50);<br />
if(i%10!=0) continue;<br />
setcolor(rand()%15+1);<br />
outtextxy(midx-textwidth(title)/2,0,title);<br />
}<br />
int pressed=getch();<br />
switch(pressed)<br />
{<br />
case 13:<br />
break;<br />
case 72:    //FOR UP<br />
if(sel!=0)<br />
{<br />
writetext(0,sel);<br />
sel&#8211;;<br />
writetext(1,sel);<br />
}<br />
goto getKey;</p>
<p>case 80:    //FOR DOWN<br />
if(sel!=MAX)<br />
{<br />
writetext(0,sel);<br />
sel++;<br />
writetext(1,sel);<br />
}<br />
goto getKey;</p>
<p>default:<br />
goto getKey;<br />
}<br />
clearbyline();<br />
return sel;<br />
}</p>
<p>void writetext(int color,int sel)<br />
{<br />
static char items[MAX+1][20]={&#8220;SINGLE PLAYER&#8221;,&#8221;DOUBLE PLAYER&#8221;,&#8221;V/S COMPUTER&#8221;,&#8221;SKILL&#8221;,&#8221;STYLE&#8221;,&#8221;HELP&#8221;,&#8221;EXIT&#8221;};</p>
<p>static int sel_size=7,nor_size=1,space=50,font=3;</p>
<p>settextstyle(font,0,nor_size);<br />
int bot_x=midx-textwidth(items[sel+1])/2;<br />
int bot_y=midy+space+textheight(items[sel+1])/2;<br />
int top_x=midx-textwidth(items[sel-1])/2;<br />
int top_y=midy-space-textheight(items[sel-1])/2;<br />
settextstyle(font,0,sel_size);<br />
int sel_x=midx-textwidth(items[sel])/2;<br />
int sel_y=midy-textheight(items[sel])/2;<br />
int sel_width=textwidth(items[sel]);<br />
//    int sel_height=textheight(items[sel]);</p>
<p>setcolor(getbkcolor());<br />
//WRITING TOP TEXT<br />
if(sel!=0)<br />
{<br />
if(color==1)<br />
setcolor(6);<br />
settextstyle(font,0,nor_size);<br />
outtextxy(top_x,top_y,items[sel-1]);<br />
}<br />
//WRITING SELECTED TEXT<br />
{<br />
if(color==1)<br />
setcolor(BLUE);<br />
settextstyle(font,0,sel_size);<br />
outtextxy(sel_x-3,sel_y-3,items[sel]);<br />
if(color==1)<br />
setcolor(WHITE);<br />
settextstyle(font,0,sel_size);<br />
outtextxy(sel_x,sel_y,items[sel]);<br />
for(int i=42;i&lt;=48;i++)<br />
{</p>
<p>if(color==1)<br />
{<br />
if(i==42||i==48)<br />
setcolor(LIGHTGRAY);<br />
else if(i==43||i==46)<br />
setcolor(WHITE);<br />
else if(i==45)<br />
setcolor(YELLOW);<br />
}<br />
line(0,sel_y+i,sel_x-10,sel_y+i);<br />
line(sel_x+sel_width,sel_y+i,getmaxx(),sel_y+i);<br />
}<br />
}</p>
<p>//WRITING BOTTOM TEXT<br />
if(sel!=MAX)<br />
{<br />
if(color==1)<br />
setcolor(GREEN);<br />
settextstyle(font,0,nor_size);<br />
outtextxy(bot_x,bot_y,items[sel+1]);<br />
}<br />
}</p>
<p>void show_help()<br />
{<br />
clearviewport();<br />
setcolor(WHITE);<br />
settextstyle(3,0,1);<br />
outtextxy(0,0,&#8221;Player 1 Keys: UP, DOWN, LEFT, RIGHT&#8221;);<br />
outtextxy(0,textheight(&#8220;F&#8221;),&#8221;Player 2 Keys: w, s, a, d (respectively)&#8221;);<br />
outtextxy(0,450,&#8221;Press any key to continue&#8230;&#8230;.&#8221;);<br />
setcolor(6);<br />
outtextxy(0,5*textheight(&#8220;F&#8221;),&#8221;Created By: Himanshu Mishra&#8221;);<br />
outtextxy(0,6*textheight(&#8220;F&#8221;),&#8221;Class: XII &#8211; E&#8221;);<br />
setcolor(GREEN);<br />
outtextxy(0,7*textheight(&#8220;F&#8221;),&#8221;School: The Air Force School, Subroto Park, New Delhi-10, India&#8221;);<br />
outtextxy(0,8*textheight(&#8220;F&#8221;),&#8221;Email-ID: himanshu_mishra007@yahoo.co.in&#8221;);</p>
<p>getch();<br />
clearviewport();<br />
}</p>
<p>void clearbyline()<br />
{<br />
for(int y=0;y&lt;=midy;y++)<br />
{<br />
delay(1);<br />
sound(400-y);<br />
setcolor(getbkcolor());<br />
line(0,y,getmaxx(),y);<br />
line(0,midy*2-y,getmaxx(),midy*2-y);<br />
}<br />
nosound();<br />
}</p>
<p>void skill_menu()<br />
{<br />
clearviewport();<br />
settextstyle(4,0,10);<br />
setcolor(GREEN);<br />
outtextxy(midx-textwidth(&#8220;SKILL&#8221;)/2,0,&#8221;SKILL&#8221;);<br />
static char skills[5][20]={&#8220;EASIEST&#8221;,&#8221;EASY&#8221;,&#8221;NORMAL&#8221;,&#8221;HARD&#8221;,&#8221;HARDEST&#8221;};<br />
static int sel=2,last_selected;<br />
ifstream o(&#8220;skill.snk&#8221;);<br />
o&gt;&gt;sel;<br />
o.close();<br />
last_selected=sel;<br />
settextstyle(3,0,4);<br />
setcolor(6);<br />
for(int i=0;i&lt;5;i++)<br />
{<br />
outtextxy(midx-textwidth(skills[i])/2,200+40*i,skills[i]);<br />
}<br />
setcolor(WHITE);<br />
outtextxy(midx-textwidth(skills[sel])/2,200+40*sel,skills[sel]);<br />
getKey:<br />
int pressed=getch();<br />
switch(pressed)<br />
{<br />
case 27:<br />
sel=last_selected;<br />
break;<br />
case 13:<br />
break;<br />
case 72:    //FOR UP<br />
setcolor(6);<br />
outtextxy(midx-textwidth(skills[sel])/2,200+40*sel,skills[sel]);<br />
sel&#8211;;<br />
if(sel&lt;0) sel=4;<br />
setcolor(WHITE);<br />
outtextxy(midx-textwidth(skills[sel])/2,200+40*sel,skills[sel]);<br />
goto getKey;</p>
<p>case 80:    //FOR DOWN<br />
setcolor(6);<br />
outtextxy(midx-textwidth(skills[sel])/2,200+40*sel,skills[sel]);<br />
sel++;<br />
if(sel&gt;4) sel=0;<br />
setcolor(WHITE);<br />
outtextxy(midx-textwidth(skills[sel])/2,200+40*sel,skills[sel]);<br />
goto getKey;<br />
default:<br />
goto getKey;<br />
}<br />
switch(sel)<br />
{<br />
case 0:<br />
speed=11; limit_computer=3;<br />
break;<br />
case 1:<br />
speed=9; limit_computer=2;<br />
break;<br />
case 2:<br />
speed=7; limit_computer=1;<br />
break;<br />
case 3:<br />
speed=5; limit_computer=0;<br />
break;<br />
case 4:<br />
speed=3; limit_computer=-1;<br />
}<br />
ofstream o1(&#8220;skill.snk&#8221;);<br />
o1&lt;&lt;sel;<br />
o1.close();<br />
clearbyline();<br />
}</p>
<p>void comment(int n)<br />
{<br />
//    static last_n=0;<br />
char comments[5][50]={&#8220;&#8221;,&#8221;Press ENTER to continue&#8230;&#8221;,&#8221;Paused!! Press Space to resume..&#8221;};</p>
<p>settextstyle(3,0,3);<br />
setcolor(BROWN);<br />
setviewport(midx-textwidth(comments[n])/2,getmaxy()-textheight(comments[n])-5,midx+textwidth(comments[n])/2,getmaxy()-5,1);<br />
outtext(comments[n]);<br />
int sel;<br />
if(n==1)<br />
{<br />
while(sel!=13)<br />
sel=getch();<br />
}<br />
else if(n==2)<br />
{<br />
sel=getch();<br />
while(sel!=32)<br />
sel=getch();<br />
}<br />
clearviewport();<br />
setviewport(0,0,639,479,1);<br />
}</p>
<p><strong>SNAKE.H</strong></p>
<p>&#8212;&#8212;-</p>
<p>//This header file stores class SNAKE that is used in Menu<br />
class SNAKE<br />
{<br />
void *bbody[2],*bmove[4],*bhead[4],*btail[4];<br />
public:<br />
int x[50],y[50],direction[50],color,fillcolor,size;    //dir-0=up,1=left,2=down,3=right<br />
int style;            //0-classic,1-new<br />
int cell_size;<br />
int offsetx,offsety;        //topx,topy (same thing:-)<br />
//member functions<br />
~SNAKE();            //-&gt;DESTRUCTOR<br />
void initialize(int,int,int,int,int,int,int);<br />
void move();<br />
void display();<br />
void reverse();<br />
int getleftdir(int dir);<br />
int gettopdir(int dir);<br />
int setdirection(int dir);<br />
int check_bite_itself();<br />
int out_of_boundary(int,int);<br />
int isat(int,int);<br />
};</p>
<p>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)<br />
{<br />
style=u_style;<br />
color=u_color;<br />
fillcolor=u_fillcolor;<br />
size=u_size;<br />
cell_size=u_cell_size;<br />
offsetx=u_offsetx;<br />
offsety=u_offsety;</p>
<p>if(style==1)<br />
{<br />
int rb=cell_size-1,pt1=cell_size/4,pt2=cell_size*3/4; //rb=right-bottom<br />
int center=rb/2;<br />
setcolor(color);<br />
setfillstyle(1,fillcolor);<br />
setviewport(0,0,rb,rb,1);</p>
<p>//Body1 ||<br />
rectangle(pt1,-1,pt2,rb+1);<br />
floodfill(center,center,getcolor());<br />
bbody[0]=malloc(imagesize(0,0,rb,rb));<br />
getimage(0,0,rb,rb,bbody[0]);<br />
clearviewport();</p>
<p>//Body2 ==<br />
rectangle(-1,pt1,rb+1,pt2);<br />
floodfill(center,center,getcolor());<br />
bbody[1]=malloc(imagesize(0,0,rb,rb));<br />
getimage(0,0,rb,rb,bbody[1]);<br />
clearviewport();</p>
<p>//move1 |~<br />
circle(rb+1,rb+1,pt2);<br />
circle(rb+1,rb+1,pt1);<br />
floodfill(center+2,center+1,getcolor());<br />
bmove[0]=malloc(imagesize(0,0,rb,rb));<br />
getimage(0,0,rb,rb,bmove[0]);<br />
clearviewport();</p>
<p>//move2 ~|<br />
circle(0,rb+1,pt2);<br />
circle(0,rb+1,pt1);<br />
floodfill(center-1,center+1,getcolor());<br />
bmove[1]=malloc(imagesize(0,0,rb,rb));<br />
getimage(0,0,rb,rb,bmove[1]);<br />
clearviewport();</p>
<p>//move3 _|<br />
circle(0,0,pt2);<br />
circle(0,0,pt1);<br />
floodfill(center-1,center-1,getcolor());<br />
bmove[2]=malloc(imagesize(0,0,rb,rb));<br />
getimage(0,0,rb,rb,bmove[2]);<br />
clearviewport();</p>
<p>//move4 |_<br />
circle(rb+1,0,pt2);<br />
circle(rb+1,0,pt1);<br />
floodfill(center+1,center-1,getcolor());<br />
bmove[3]=malloc(imagesize(0,0,rb,rb));<br />
getimage(0,0,rb,rb,bmove[3]);<br />
clearviewport();</p>
<p>//head 1    (~)<br />
sector(cell_size/2,cell_size,0,180,cell_size/4,cell_size/2);<br />
putpixel(cell_size/2+2,cell_size/2+4,0);<br />
putpixel(cell_size/2-2,cell_size/2+4,0);<br />
bhead[0]=malloc(imagesize(0,0,rb,rb));<br />
getimage(0,0,rb,rb,bhead[0]);<br />
clearviewport();</p>
<p>//head 2    ==*<br />
fillellipse(0,cell_size/2,cell_size/2,cell_size/4);<br />
putpixel(cell_size/2-4,cell_size/2+2,0);<br />
putpixel(cell_size/2-4,cell_size/2-2,0);<br />
bhead[1]=malloc(imagesize(0,0,rb,rb));<br />
getimage(0,0,rb,rb,bhead[1]);<br />
clearviewport();</p>
<p>//head 3    (_)<br />
fillellipse(cell_size/2,0,cell_size/4,cell_size/2);<br />
putpixel(cell_size/2+2,cell_size/2-4,0);<br />
putpixel(cell_size/2-2,cell_size/2-4,0);<br />
bhead[2]=malloc(imagesize(0,0,rb,rb));<br />
getimage(0,0,rb,rb,bhead[2]);<br />
clearviewport();</p>
<p>//head 4    *==<br />
sector(cell_size,cell_size/2,90,270,cell_size/2,cell_size/4);<br />
putpixel(cell_size/2+4,cell_size/2+2,0);<br />
putpixel(cell_size/2+4,cell_size/2-2,0);<br />
bhead[3]=malloc(imagesize(0,0,rb,rb));<br />
getimage(0,0,rb,rb,bhead[3]);<br />
clearviewport();</p>
<p>//tail1        \/<br />
fillellipse(cell_size/2,0,cell_size/4,cell_size);<br />
btail[0]=malloc(imagesize(0,0,rb,rb));<br />
getimage(0,0,rb,rb,btail[0]);<br />
clearviewport();</p>
<p>//tail2        &lt;<br />
fillellipse(cell_size,cell_size/2,cell_size,cell_size/4);<br />
btail[1]=malloc(imagesize(0,0,rb,rb));<br />
getimage(0,0,rb,rb,btail[1]);<br />
clearviewport();</p>
<p>//tail3        /\<br />
fillellipse(cell_size/2,cell_size,cell_size/4,cell_size);<br />
btail[2]=malloc(imagesize(0,0,rb,rb));<br />
getimage(0,0,rb,rb,btail[2]);<br />
clearviewport();</p>
<p>//tail4        &gt;<br />
fillellipse(0,cell_size/2,cell_size,cell_size/4);<br />
btail[3]=malloc(imagesize(0,0,rb,rb));<br />
getimage(0,0,rb,rb,btail[3]);<br />
clearviewport();</p>
<p>setviewport(0,0,639,479,1);<br />
}<br />
for(int i=0;i&lt;size;i++)<br />
{<br />
x[i]=0;<br />
y[i]=size-i-1;<br />
direction[i]=2;<br />
move();<br />
//        display();<br />
}<br />
}</p>
<p>SNAKE::~SNAKE()            //Destructor<br />
{<br />
if(style==1)<br />
{<br />
for(int i=0;i&lt;4;i++)<br />
{<br />
if(i&lt;2)<br />
free(bbody[i]);<br />
free(bmove[i]);<br />
free(bhead[i]);<br />
free(btail[i]);<br />
}<br />
}<br />
}</p>
<p>void SNAKE::move()<br />
{<br />
for(int i=size+1;i&gt;0;i&#8211;)<br />
{<br />
x[i]=x[i-1];<br />
y[i]=y[i-1];<br />
}</p>
<p>if(direction[0]==0) y[0]&#8211;;<br />
else if(direction[0]==1) x[0]++;<br />
else if(direction[0]==2) y[0]++;<br />
else if(direction[0]==3) x[0]&#8211;;<br />
}</p>
<p>void SNAKE::display()<br />
{<br />
//To delete the last cell<br />
{<br />
setviewport(offsetx+cell_size*x[size],offsety+cell_size*y[size],offsetx+cell_size*(x[size]+1),offsety+cell_size*(y[size]+1),1);<br />
clearviewport();<br />
setviewport(0,0,639,479,1);<br />
}<br />
int cx,cy;</p>
<p>if(style==0)        //classic<br />
{<br />
cx=offsetx+cell_size*x[0]+cell_size/2;<br />
cy=offsety+cell_size*y[0]+cell_size/2;</p>
<p>setcolor(color);<br />
circle(cx,cy,cell_size/2-1);<br />
setfillstyle(1,fillcolor);<br />
floodfill(cx,cy,color);<br />
}<br />
else if(style==1)<br />
{<br />
cx=offsetx+cell_size*x[size-1];<br />
cy=offsety+cell_size*y[size-1];<br />
putimage(cx,cy,btail[direction[size-2]],COPY_PUT);</p>
<p>cx=offsetx+cell_size*x[0];<br />
cy=offsety+cell_size*y[0];<br />
putimage(cx,cy,bhead[direction[0]],COPY_PUT);</p>
<p>cx=offsetx+cell_size*x[1];<br />
cy=offsety+cell_size*y[1];</p>
<p>if((direction[1]==0 &amp;&amp; direction[0]==1) || (direction[1]==3 &amp; direction[0]==2))<br />
putimage(cx,cy,bmove[0],COPY_PUT);<br />
else if((direction[1]==0 &amp;&amp; direction[0]==3) || (direction[1]==1 &amp;&amp; direction[0]==2))<br />
putimage(cx,cy,bmove[1],COPY_PUT);<br />
else if((direction[1]==1 &amp;&amp; direction[0]==0) || (direction[1]==2 &amp;&amp; direction[0]==3))<br />
putimage(cx,cy,bmove[2],COPY_PUT);<br />
else if((direction[1]==2 &amp;&amp; direction[0]==1) || (direction[1]==3 &amp;&amp; direction[0]==0))<br />
putimage(cx,cy,bmove[3],COPY_PUT);<br />
else if(getleftdir(direction[1])!=0 &amp;&amp; getleftdir(direction[0])!=0)<br />
putimage(cx,cy,bbody[1],COPY_PUT);<br />
else    putimage(cx,cy,bbody[0],COPY_PUT);<br />
}</p>
<p>//no further use can be changed<br />
for(int i=size;i&gt;0;i&#8211;)<br />
direction[i]=direction[i-1];<br />
}</p>
<p>void SNAKE::reverse()<br />
{<br />
for(int i=0;i&lt;size;i++)<br />
{<br />
x[i]=x[i+1];<br />
y[i]=y[i+1];<br />
direction[i]=direction[i+1];<br />
}<br />
}</p>
<p>int SNAKE::getleftdir(int dir)<br />
{<br />
if(dir==1) return 1;<br />
else if(dir==3) return -1;<br />
else return 0;<br />
}<br />
int SNAKE::gettopdir(int dir)<br />
{<br />
if(dir==0) return -1;<br />
else if(dir==2) return 1;<br />
else return 0;<br />
}<br />
int SNAKE::setdirection(int dir)<br />
{<br />
int moved=1;<br />
if(dir==1 &amp;&amp; direction[1]!=3) direction[0]=1;<br />
else if(dir==2 &amp;&amp; direction[1]!=0) direction[0]=2;<br />
else if(dir==3 &amp;&amp; direction[1]!=1) direction[0]=3;<br />
else if(dir==0 &amp;&amp; direction[1]!=2) direction[0]=0;<br />
else moved=0;</p>
<p>return moved;<br />
}</p>
<p>int SNAKE::check_bite_itself()<br />
{<br />
for(int i=1;i&lt;size;i++)<br />
if(x[0]==x[i] &amp;&amp; y[0]==y[i])<br />
return 1;<br />
return 0;<br />
}</p>
<p>int SNAKE::out_of_boundary(int max_row,int max_column)<br />
{<br />
if(x[0]&lt;0 || y[0]&lt;0 || x[0]&gt;=max_row || y[0]&gt;=max_column)<br />
return 1;<br />
return 0;    //no need for else<br />
}</p>
<p>int SNAKE::isat(int row,int column)<br />
{<br />
for(int i=0;i&lt;size;i++)<br />
if(x[i]==row &amp;&amp; y[i]==column)<br />
return 1;<br />
return 0;<br />
}<br />
/************************************************************/<br />
/************************************************************/</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/techguru08.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/techguru08.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techguru08.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techguru08.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techguru08.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techguru08.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techguru08.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techguru08.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techguru08.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techguru08.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techguru08.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techguru08.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techguru08.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techguru08.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techguru08.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techguru08.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techguru08.wordpress.com&amp;blog=3575138&amp;post=4&amp;subd=techguru08&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techguru08.wordpress.com/2008/04/25/snake-game-in-cpp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/629364e97bc4fddd5ac73245f5573fee?s=96&#38;d=identicon" medium="image">
			<media:title type="html">techguru08</media:title>
		</media:content>
	</item>
		<item>
		<title>Creating CON folder</title>
		<link>http://techguru08.wordpress.com/2008/04/25/creating-con-folder/</link>
		<comments>http://techguru08.wordpress.com/2008/04/25/creating-con-folder/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 08:03:03 +0000</pubDate>
		<dc:creator>techguru08</dc:creator>
				<category><![CDATA[windows tricks]]></category>

		<guid isPermaLink="false">http://techguru08.wordpress.com/?p=3</guid>
		<description><![CDATA[If u hav not heard of CON folder,, try creating a folder named &#8220;con&#8221; in windows. u cant create it directly&#8230; 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 &#8220;con&#8221; is impossible. although u can create it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techguru08.wordpress.com&amp;blog=3575138&amp;post=3&amp;subd=techguru08&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If u hav not heard of CON folder,, try creating a folder named &#8220;con&#8221; in windows.</p>
<p>u cant create it directly&#8230;</p>
<p>bcos CON is the name assigned for windows configuration folder by microsoft.</p>
<p>n similarly named folders can create confusion 4 th os. so creating folder named &#8220;con&#8221; is impossible.</p>
<p>although u can create it using the method below, the folder is useless, u cant use it nor delete it.</p>
<p>Follow these steps to create CON folder :-</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>STEP1: goto command prompt</p>
<p>STEP2: and type md \\.\\&#8221;c:\con&#8221; (with quotes, better you copy and past it)</p>
<p>the above command will create the folder named &#8220;con&#8221; in Drive C:</p>
<p>To create that folder in your desktop (for Windows XP) replace the &#8216;c:\con&#8217; with the FULL PATH of your Desktop, Below is an Example:</p>
<p>md \\.\\&#8221;C:\Documents and Settings\USER\Desktop\con&#8221; (Where USER is your USERNAME)</p>
<p>(You MUST specify the full path within double quotes ["] If it contains spaces)</p>
<p>In Windows 98, your Desktop path would be : C:\windoiws\Desktop (where C: is the drive letter if your Windows installation)</p>
<p>That is all about creating the folder.</p>
<p>BUT DON&#8217;T STOP HERE<br />
Because after creating such a folder, you can&#8217;t delete it by simply pressing the DEL key.<br />
To delete this kind of folder, use the same command replacing MD with RD. For example:</p>
<p>rd \\.\\&#8221;c:\con&#8221; (with quotes for path containing spaces)</p>
<p>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:<br />
AUX, COM1, COM2, COM3, COM4, LPT1, LPT2, LPT3, PRN, NUL</p>
<p>more info can be found here&#8211;&gt; http://kerneltrap.org/node/5772</p>
<p>======================================&#8230;<br />
NOTE: PLEASE BE CAREFUL WHEN MAKING ANY FOLDER USING ABOVE NAMES, AS THEY MIGHT CREATE SOME PROBLEMS IN WINDOWS</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/techguru08.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/techguru08.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techguru08.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techguru08.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techguru08.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techguru08.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techguru08.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techguru08.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techguru08.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techguru08.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techguru08.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techguru08.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techguru08.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techguru08.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techguru08.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techguru08.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techguru08.wordpress.com&amp;blog=3575138&amp;post=3&amp;subd=techguru08&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techguru08.wordpress.com/2008/04/25/creating-con-folder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/629364e97bc4fddd5ac73245f5573fee?s=96&#38;d=identicon" medium="image">
			<media:title type="html">techguru08</media:title>
		</media:content>
	</item>
		<item>
		<title>Hello world!</title>
		<link>http://techguru08.wordpress.com/2008/04/25/hello-world/</link>
		<comments>http://techguru08.wordpress.com/2008/04/25/hello-world/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 07:37:49 +0000</pubDate>
		<dc:creator>techguru08</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techguru08.wordpress.com&amp;blog=3575138&amp;post=1&amp;subd=techguru08&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Welcome to <a href="http://wordpress.com/">WordPress.com</a>. This is your first post. Edit or delete it and start blogging!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/techguru08.wordpress.com/1/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/techguru08.wordpress.com/1/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techguru08.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techguru08.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techguru08.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techguru08.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techguru08.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techguru08.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techguru08.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techguru08.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techguru08.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techguru08.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techguru08.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techguru08.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techguru08.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techguru08.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techguru08.wordpress.com&amp;blog=3575138&amp;post=1&amp;subd=techguru08&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techguru08.wordpress.com/2008/04/25/hello-world/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/629364e97bc4fddd5ac73245f5573fee?s=96&#38;d=identicon" medium="image">
			<media:title type="html">techguru08</media:title>
		</media:content>
	</item>
	</channel>
</rss>
