How to make a snake game in C plus plus which can be played in the console screen.
This c++ program will create the following snake game. You will be able to play this game using your A, W, S, D buttons of keyboard.
#include<iostream>
#include<conio.h>
#include<Windows.h>
using namespace std;
bool gameOver;
const int width = 20;
const int height = 20;
int x, y, fruitX, fruitY, score;
int tailX[100], tailY[100];
int nTail;
enum eDirection { STOP = 0, LEFT, RIGHT, UP, DOWN };
eDirection dir;
