PSA re: possible fix to srand(time(NULL)) not working (Section 2: Chapter 29)

Hey all,

After getting to the random number generation part on Section 2, Chapter 29, I followed the instructions for implementing the srand() function and found I was still getting the same number combinations, even on higher difficulties, no matter how many times I tried compiling and running the code, as though the code wasn’t using the srand() function.

If this is an issue you’re facing, try exiting the terminal and opening up a new one. I think my terminal at the time was chock full of commands and game instances which caused an issue with compiling and running. Hope this helps some people!

Privacy & Terms