Better random algorithm?

后端 未结 14 1784
情书的邮戳
情书的邮戳 2020-12-16 06:48

I\'m making a game in C++ and it involves filling tiles with random booleans (either yes or no) whether it is yes or no is decided by rand() % 1. It doesn\'t fe

14条回答
  •  执念已碎
    2020-12-16 07:27

    A quick thing that might make your numbers feel a bit more random would be to re-seed the generator each time the condition if(rand() % 50==0) is true.

提交回复
热议问题