- MATCH STICK GAME
void main()
{
int matchs=21,user,comp;
printf("\n THREE GOLDEN RULE:");
printf("\n 1. You have 21 match stick");
printf("\n 2. You have to choose matchstick from 1 to 4");
printf("\n 3. Computer always wins");
while(matchs>1)
{
if(matchs==1)
break;
printf("\n Your turn:");
printf("\n Matchsticks remaining %d ",matchs);
printf("\n Pick your match stick 1 to 4:");
scanf("%d",&user);
comp=5-user;
printf("\n Computer turn:");
printf("\n Compter choose %d",comp);
matchs=matchs-user-comp;
}
printf("\n 1 matchsticks remains for you");
printf("\n Computer Wins");
}
ANY ONE TELL ME THIS GAME IN C++ WORK?
ReplyDeletethis is not C++ syntax
ReplyDelete