Code:
#define _CRT_SECURE_NO_WARNINGS
#define MAX_GUESSES 3
#include<stdio.h>
#include<ctype.h>
#include<string.h>
//This function will explain the game rules
void gameRules();
//This will print *'s that will be the same as length as the word.
void partialWord(char[]);
//This Funtion
int playJumble(char[]);
int main(){
FILE*txtWord;
char solution[255];
gameRules();
txtWord = fopen("getWords.txt", "r");
fscanf(txtWord, "%s", solution);
printf("\nHere is the word!\n%s\n", solution);
partialWord(solution);
fclose(txtWord);
return;
}
void gameRules(){
printf("Welcome to the KSG Edition of Jumbled!!!\n");
printf("----------------------------------------------\n");
printf("To play, you will get a random, scrambled word. Then, it's up to the player \nto guess and figure out the word in three tries. If they succeed, they win! Are\nyou up for it?\n");
}
void partialWord(char current[]){
int n;
int i;
n = strlen(current);
for (i = 0; i < n; i++){
current[i] = "*";
}
printf("%s\n", current);
}
Welcome to the KSG Edition of Jumbled!!!
----------------------------------------------
To play, you will get a random, scrambled word. Then, it's up to the player
to guess and figure out the word in three tries. If they succeed, they win! Are
you up for it?
Here is the word!
spanhpsie
╨╨╨╨╨╨╨╨╨
Press any key to continue . . .