हेलो दोस्तों !
आज की इस word guessing game project कैसे बनाये in C language | with source code पोस्ट में हम word guessing game का project C programming की मदद से बनाना सीखेंगे। तो दोस्तों अगर आप इस प्रोजेक्ट को अच्छी तरह समझना चाहते है तो इस पोस्ट को अंत तक जरूर पढ़े।
इस पोस्ट के मुख्य टॉपिक्स निन्म है -
- word guessing game क्या है ?
- word guessing game project कैसे work करेगा।
- word guessing game project का source code .
- word guessing game project video.
1. word guessing game क्या है :-
2. word guessing game project कैसे work करेगा :-
3. word guessing game project का source code :-
project source code :-
#include< stdio.h >
#include< string.h >
#include< stdlib.h >
char *phoneBrand[]={"Nokia","Sumsung","Apple","Oppo","Micromax","Intex"};
int chance=5,correctWord=0;
void showResult()
{
if (correctWord>=5)
{
printf("\n**********************************************\n");
printf("| Congratulation! You won the Game |\n");
printf("| You have guessed %d words correctly |\n",correctWord);
printf("**********************************************\n\n");
}else
{
printf("\n**********************************************\n");
printf("| Sorry! You lose the Game |\n");
printf("| You have guessed %d words correctly |\n",correctWord);
printf("**********************************************\n\n");
}
}
void checkWord(int i,char *guessWord)
{
if (0==strcmp(guessWord,phoneBrand[i]))
{
printf("Correct Guess\n");
correctWord++;
}else
{
printf("Wrong Guess\n");
chance--;
}
}
void startGame()
{
char guessWord[15];
printf("\nYou have only %d chance\n",chance);
printf("Total correct word %d\n",correctWord);
printf("Guess which phone brand name is this\n");
printf(" N_k_a: ");
fflush(stdin);
gets(guessWord);
checkWord(0,guessWord);
printf("\nYou have only %d chance\n",chance);
printf("Total correct word %d\n",correctWord);
printf("Guess which phone brand name is this\n");
printf(" S_m_u_g: ");
fflush(stdin);
gets(guessWord);
checkWord(1,guessWord);
printf("\nYou have only %d chance\n",chance);
printf("Total correct word %d\n",correctWord);
printf("Guess which phone brand name is this\n");
printf(" A_p_e: ");
fflush(stdin);
gets(guessWord);
checkWord(2,guessWord);
printf("\nYou have only %d chance\n",chance);
printf("Total correct word %d\n",correctWord);
printf("Guess which phone brand name is this\n");
printf(" _p_o: ");
fflush(stdin);
gets(guessWord);
checkWord(3,guessWord);
printf("\nYou have only %d chance\n",chance);
printf("Total correct word %d\n",correctWord);
printf("Guess which phone brand name is this\n");
printf(" M_c_om_x: ");
fflush(stdin);
gets(guessWord);
checkWord(4,guessWord);
printf("\nYou have only %d chance\n",chance);
printf("Total correct word %d\n",correctWord);
printf("Guess which phone brand name is this\n");
printf(" _n_ex: ");
fflush(stdin);
gets(guessWord);
checkWord(5,guessWord);
showResult();
}
void main()
{
char ch;
printf("\n*******Welcome to word guessing Game*******\n\n");
printf("Here are few rules of this Game\n");
printf("1.Total guess word is 6\n");
printf("2.You need to guess 5 word correctly to win the Game\n");
printf("3.You have 5 chance to win the Game\n");
printf("4.Every wrong guess you lose 1 chance\n");
printf("For start Game press Y otherwise press N\n");
fflush(stdin);
ch=getchar();
if (ch=='Y'||ch=='y')
{
startGame();
}else
{
exit(0);
}
}
project output :-
*******Welcome to word guessing Game*******
Here are few rules of this Game
1.Total guess word is 6
2.You need to guess 5 word correctly to win the Game
3.You have 5 chance to win the Game
4.Every wrong guess you lose 1 chance
For start Game press Y otherwise press N
y
You have only 5 chance
Total correct word 0
Guess which phone brand name is this
N_k_a: Nokia
Correct Guess
You have only 5 chance
Total correct word 1
Guess which phone brand name is this
S_m_u_g: Sumsung
Correct Guess
You have only 5 chance
Total correct word 2
Guess which phone brand name is this
A_p_e: Apple
Correct Guess
You have only 5 chance
Total correct word 3
Guess which phone brand name is this
_p_o: Oppo
Correct Guess
You have only 5 chance
Total correct word 4
Guess which phone brand name is this
M_c_om_x: Micromax
Correct Guess
You have only 5 chance
Total correct word 5
Guess which phone brand name is this
_n_ex: Index
Wrong Guess
**********************************************
| Congratulation! You won the Game |
| You have guessed 5 words correctly |
**********************************************
4. word guessing game project video :-
दोस्तों अगर आप इस प्रोजेक्ट की वीडियो को देखना चाहते है तो इसका लिंक हमने नीचे दिया है। इस वीडियो में हमने इस गेम प्रोजेक्ट को अच्छी तरह समझाया है और साथ में इस गेम प्रोजेक्ट को रन करके भी दिखाया तो अगर आप इस वीडियो को देखना चाहते है तो नीच लिंक पर क्लिक करके देख सकते है।
वीडियो देखने के लिए यहाँ क्लिक करें।
इन पोस्ट को भी पढ़े :-
- सिंपल वोटिंग सिस्टम प्रोजेक्ट इन C
- सिंपल स्टूडेंट अटेंडेंस प्रोजेक्ट इन C
- simple quiz game project in C
Author :- तो दोस्तों अब हमारी यह word guessing game project कैसे बनाये in C language | with source code पोस्ट ख़त्म होती है हम आशा करते है की हमारी यह पोस्ट आपको जरूर पसंद आई होगी और आप इस word guessing game project को अच्छी तरह समझ गए होंगे। तो दोस्तों आज के लिए बस इतना ही फिर मिलेंगे ऐसी ही किसी और इंटरेस्टिंग पोस्ट में तब तक के लिए अलविदा !
0 Comments
Do not enter any spam comments please.