Not sure how to fix it yet, but an SRand will keep repeating the same numbers unless there is a time interval. Some kind of pause. Normally a Sleep(1000); would be enough, but it uses the <windows.h> library, which I don't think this code compiler allows.