⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dice.cpp

📁 为大家搜集免费的计算机学习、编程资料和优秀的网络资源。多多支持
💻 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 + -