Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int i, j, k, num_words, num_games;
- char game_board[SIZE][SIZE];
- FILE* ifp;
- ifp = fopen("dictionary.txt", "r");
- struct alphatreenode* dictionary = (struct alphatreenode*)malloc(sizeof(struct alphatreenode));
- dictionary->isWord = 0;
- for(i=0; i<26; i++){
- dictionary->nextLetter[i] = NULL;
- }
- fscanf(ifp, "%d", &num_words);
- for(i=0; i<num_words; i++){
- char word[20];
- fscanf(ifp, "%s", word);
- if(strlen(word) > 2 && strlen(word) < 17){
- //printf("Inserting: %s\n", word);
- insertWord(dictionary, word);
- //printf("Finished inserting.\n");
- }
- }
- fclose(ifp);
- ifp = fopen("boggle.txt", "r");
- fscanf(ifp, "%d", &num_games);
- for(i=0; i<num_games; i++){
- for(j=0; j<SIZE; j++){
- for(k=0; k<SIZE; k++)
- fscanf(ifp, "%c", game_board[j][k]);
- }
- }
Add Comment
Please, Sign In to add comment