tu_random.h
来自「一个开源的Flash 播放器,可以在Windows/Linux 上运行」· C头文件 代码 · 共 52 行
H
52 行
// tu_random.h -- Thatcher Ulrich 2003// This source code has been donated to the Public Domain. Do// whatever you want with it.// Pseudorandom number generator.#ifndef TU_RANDOM_H#define TU_RANDOM_H#include "base/tu_config.h"#include "base/tu_types.h"namespace tu_random{ // Global generator. Uint32 next_random(); void seed_random(Uint32 seed); float get_unit_float(); // In case you need independent generators. The global // generator is just an instance of this. const int SEED_COUNT = 8; struct generator { generator(); void seed_random(Uint32 seed); // not necessary Uint32 next_random(); float get_unit_float(); private: Uint32 Q[SEED_COUNT]; Uint32 c; Uint32 i; };} // end namespace tu_random#endif // TU_RANDOM_H// Local Variables:// mode: C++// c-basic-offset: 8 // tab-width: 8// indent-tabs-mode: t// End:
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?