Skip to main content

Posts

Showing posts from July, 2014

Rattle Snake Game

Rattle Snake Game in C and C++ Hello friends this is a simple projects on snake game. It is simply different from my first snake warz game. You can run this game in DOS BOX and TURBOC compilers. copy this code in your file... //Rattle Snake - A excellent snake game developed in c/c++. #include <graphics.h> #include <stdlib.h> #include <stdio.h> #include <conio.h> #include <dos.h> #include <iostream.h> #include <fstream.h> #include <string.h> int main() {    int gdriver = DETECT, gmode, errorcode;    void *body,*food,*tail1,*tail2,*tail3,*tail4,*head1,*head2,*head3,*head4;    int x, y,X[5000],Y[5000],i=3, maxx,maxy,speed=100,bo=10,t[10],score=0,hscore=20;    unsigned int size;    char a='6',b,scor[4],hs[4];    int k=2,l,r1,r2,f=0,z=100,first=0,second=1;;    r1=300;    r2=350;    ifstream infile("c:\tc\bin\rattle.txt");    infile.getline(hs,4);    infile.close();    hscore = atoi(hs)