small game version c++
you can simply devolop a snake game in C++. If u r devoloping in Turbo C u have to include graphics library. There will be sample programs to show how to use graphics in C.
There is no need to use linked list for this. But if u want u can use.
Shape of the snake can be created using rectangles. There are functions to create rectangle. U can have 7 or 8 rectangles on the screen one after the other.
Let the postion of the 1st rectangle is (x,y). U can create the rectangles like rect(x-5, y-5,x+5,y+5). The other rectangles can also be created like this. Thus we got a snake that is not moving.
We have to store all these coordintes in an array or linked list.
if it is a linked list node can be like this
struct node
{
int x; //x-coordinate
int y; //y coordinate
struct node * next; //pointer to the next node
}
Create a linked list of fixed number of nodes that corresponsds to the length of snake.
Now we have to move the snake. There is one functin clrscr(), it will clear the screen. We have to move the snake a step ahead and draw the snake again.
Now control the direction according to the keyboard input.
This is the idea. rest is upto u.