#include "myio.h"
#include "stdio.h"
int main()
{
int i,j,b,a;
do{
b=21;
system("cls");
myprintf(20,2,40,"*");
myprintf(20,23,40,"*");
myprintf(25,3,1,"Stick Game-human vs. computer!");
do{
myprintf(26,4,1,"You need enter:");
while(getchse("1234",DEF_POS)-'0');
if(i<=4&&i>=1){
j=5-i;
b-=5;
myprintf(27,5,1,"The leftover stick:%2d",b);
myprintf(28,6,1,"I get %d sticks!",j);
}
else continue;
}while(b>1);
myprintf(21,14,2,"You lose!");
myprintf(20,15,1,"Game Over!I win !Again(y/n)?");
}while(getchse("yn",DEF_POS) == 'y');
return 0;
}
#include "stdio.h"
int main()
{
int i,j,b,a;
do{
b=21;
system("cls");
myprintf(20,2,40,"*");
myprintf(20,23,40,"*");
myprintf(25,3,1,"Stick Game-human vs. computer!");
do{
myprintf(26,4,1,"You need enter:");
while(getchse("1234",DEF_POS)-'0');
if(i<=4&&i>=1){
j=5-i;
b-=5;
myprintf(27,5,1,"The leftover stick:%2d",b);
myprintf(28,6,1,"I get %d sticks!",j);
}
else continue;
}while(b>1);
myprintf(21,14,2,"You lose!");
myprintf(20,15,1,"Game Over!I win !Again(y/n)?");
}while(getchse("yn",DEF_POS) == 'y');
return 0;
}