Mersenne Twister for ActionScript 3
我尝试将Mersenne Twister移植到ActionScript上。
http://www.math.sci.hiroshima-u.ac.jp/~m-mat/mt/mt/mt2002/mt19937ar.html
概述
- 我认为除非它是11岁或以后的Flash Player,否则它不会起作用。
- 我正在使用FLASCC 1.0.1来构建分发代码。
- 当您构建它时,它将在SWC中输出。
- AS3API.C是Flash的接口部分。我不使用swig。
- ActionScript样本在样本文件夹中。
如何与Flascc建造
我只知道窗户,
- 从flascc_1.0.1/run.bat启动cygwin
- 导出lang = c
进入 - 移至源代码与CD的目录
- 制作flascc =“/path/to/flascc_1.0.1/sdk” flex =“/path/to/flex_sdk_4.6/”
我认为将通过
操作检查环境
- FlashDevelop 4.3.0
- Flex SDK 4.6
- Flash Player 11
- FLASCC 1.0.1
运行速度
我将其与Math.random()进行了比较(当我用调试构建跑了100万次时)。
- Math.random():112ms
- genrand_int32():250ms
- genrand_int31():252ms
- genrand_real1():253ms
- genrand_real2():255ms
- genrand_real3():251ms
- genrand_res53():360ms