Simple text based game in C
Good:

no warnings with -Wall -Wextra -pedantic with both gcc and clang, no
memory leaks found with valgrind.

Bad:

use prototypes instead of declarations to give compiler a chance
to issue warnings when an incorrect number of parameters is passed or incorrect types are passed:

void play(void)
int main(void)


You don't check if user passes correct acceptable difficulty level:

$ ./main
1 = EASY, 2 = MEDIUM, 3 = HARD, &amp; 4 = INSANE
What level would you like to play: 6
Floating point exception
$ ./main
1 = EASY, 2 = MEDIUM, 3 = HARD, &amp; 4 = INSANE
What level would you like to play: 0
Floating point exception


You don't check if user passes an integer in the first place:

$ ./main
1 = EASY, 2 = MEDIUM, 3 = HARD, &amp; 4 = INSANE
What level would you like to play: a


will make your program go into an endless loop.

Suggested:

convert int difficulty = 1 into an en enum with additional DIFFICULTY_MAX and DIFFICULTY_MIN values, and check if value passed from the user is lower than DIFFICULTY_MAX and larger or equal to DIFFICULTY_MIN.

Use EXIT_SUCCESS to denote success at the end of main():

return EXIT_SUCCESS;


or just omit the return from main() - compiler will automatically return a success value if we run off the end.