Monday 27 January 2014

MINESWEEPER in turbo c

Introduction
Minesweeper is a single player game. The objective of the game is to clear an abstract minefield without detonating the mine.
Developed In
C(with 32 bit turbo c compiler)
Input
a - Moves the cursor left.
s - Moves the cursor down.
w - Moves the cursor up.
d - Moves the cursor right.
e - Enter key.
x - Exit key.
Feature
·         Made on the input/output console without the use of Graphics function.
·         Interface of the game is developed using textbackground color and text color.
·         Bombs are placed randomly each time the game starts.
Implementation
Important variables
Description
Int a[110]
Index represent the position and value  represent thr presence of bomb or not.
0-bomb
9-no bomb in the surrounding
After enter(e) all values are increased with 10.
Static int c
Current cursor position.
int r1,r2,r3
Random variables
User defined function
Important functions
Description
int main()
Placing of bomb at random places.
Counting the total number of bombs in surrounding.
Call to graphics function.
void graphics(int a[110])
Renders the graphics for interface.
int cursor()
Returns the position of the cursor.
void gamechanger(int a[110],int j)
Unlocks the area until it encounters number or boundary.

References
Let us c-Yeshvant Kanethkar
Minesweeper
Snapshot 1


Snapshot 2



No comments:

Post a Comment