summaryrefslogtreecommitdiff
path: root/session.c
blob: 0b0c11df0793716e660e4f6fb3312b5eead97309 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <stdio.h>
#include <stdlib.h>
#include "session.h"

void startSession(FILE *dictionary)
{
	if ( dictionary != NULL )
	{
		int totalWords = lineCounter(dictionary);
		char* word = (char *) calloc(256, sizeof(char));
		char reload;

		while( reload != 'q' )
		{
			word = getLine(dictionary, getRandomNumber(1, totalWords));
			printf("%s\n", word);
			free(word);
			//reload = getchar();
			//getchar();
		}
	}
}