answersLogoWhite

0

A c program of matchstick game?

Updated: 12/13/2022
User Avatar

Wiki User

13y ago

Best Answer

#include

#include

void main()

{

int matc=21,x,y;

char ch;

clrscr();

printf(" WELCOME TO THE WORLD OF GAMING \n");

printf("");

printf(" MATCH STICK GAME \n");

printf("/n");

printf("PRESS ANY KET TO KNOW THE RULES \n");

scanf("%c",&ch);

printf("This is a game between user and computer \n There are 21 match sticks user have to pick

1,2,3 or 4 match stick in one turn \n One who pick up the last match stick loose the game \n");

printf(" number above 4 is invalid \n");

printf("if u do this computer automatically wins");

printf("ALL THE BEST \n");

for(int i=1;i<=4;i++)

{

printf("pick up the match sticks 1-4 \n");

scanf("%d",&x);

y=5-x;

printf("i have pick up %d \n",y);

matc=matc-(x+y);

printf("the remaining match stick is %d \n",matc);

if(matc==1x>4)

break;

}

if(matc==1)

{

printf(" your turn pick up the last one \n");

scanf("%d",&x);

printf("you loose");

printf("MUMMY KO BOLO COMPLAIN PILAYE \n");

printf("\t THANKS \n");

}

else

{

printf("you loose because of abiding rules");

getch();

}

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: A c program of matchstick game?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is a C plus plus game project program?

A C++ game project program could either be a game written in C++ or a C++ library that helps you develop a game.


What is game directory?

All depends on the the game most likely it will be [harddrive]:\Program Files\ [Name of the Company that made it] \ [name of the game] \ Or [harddrive]:\Program Files\ [name of the game] \


Who invented the matchstick?

J.E. Lundstrom invented Matchstick..


When was Matchstick Palace created?

Matchstick Palace was created in 1931.


When was Matchstick Sun created?

Matchstick Sun was created in 1984.


Where is the examples folder on game maker 7.0 lite?

C:\Program Files (x86)\Game_Maker7 if you have a windows 7 if you have an older computer it should be in C:\Program Files\Game_Maker7


Was the lyric matchstalk men and matchstalk cats and dogs or matchstick men and matchstick cats and dogs?

The lyric was "Matchstick men and Matchstick cats and dogs" based on a painting by a Manchester artist.


Is c plus plus can be used in game programming?

yes! why not! this c program is used in ATM servicesand also in games.


Three letter name for a matchstick game beginning with the letter n and ending in the letter m?

Nim


What is the duration of Matchstick Men?

The duration of Matchstick Men is 1.93 hours.


How do you make a program of a game by using the C programming language?

Typically you won't use C to write games, particularly non-trivial games. C++ is the language of choice for most game developers.


What script should you learn if you want to program video games?

The most useful programming languages to learn for video game development would be C and C++ if you are looking to program on consoles and PCs.