-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
35 lines (27 loc) · 797 Bytes
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* hw3-main.c */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int total_guesses;
int total_wins;
int total_losses;
char ** words;
/* write the wordle_server() function and place all of your code in hw3.c */
int wordle_server( int argc, char ** argv );
int main( int argc, char ** argv )
{
total_guesses = total_wins = total_losses = 0;
words = calloc( 1, sizeof( char * ) );
if ( words == NULL ) { perror( "calloc() failed" ); return EXIT_FAILURE; }
int rc = wordle_server( argc, argv );
/* on Submitty, there will be more code here that validates
* the global variables at the end of your code...
*/
/* deallocate memory for the list of words played */
for ( char ** ptr = words ; *ptr ; ptr++ )
{
free( *ptr );
}
free( words );
return rc;
}