📄 dice.cpp
字号:
#include "Dice.h"
// function used to seed the random number generator
// one possible side-effect of this is if a program creates it's first Dice object after it
// has set the seed to a particular value, the random number generator will be reseeded to
// a different (except in the fluke wild chance that the numbers match)
void InitializeRandomizer()
{
// used to determine if srand has already been run once
// since it is static it will remain the same for as long as the program runs
static bool initialized = false;
// if it hasn't been initialized, do so now
if(! initialized)
{
// this function initializes the random number generator
srand( (unsigned)time( NULL ) );
// set initialized to true to prevent further initializations
initialized = true;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -