Coder Social home page Coder Social logo

mt19937's Introduction

MT19937-64伪随机算法代码集

MT19937-64是梅森旋转算法的64位实现,通用于各种编程语言的伪随机数生成算法。

本代码仓库收集整理了不同语言的MT19937-64算法实现,并做了测试。

可以用于客户端运算服务端验证型的游戏项目。

由服务端下发随机种子,由于算法一致,所以客户端每次随机的结果都是服务端可验证的。

用法

  1. 对于Unity之类的C#项目,只需要把mt19937.cs文件放入项目中即可。
  2. 对于Go语言项目,把go目录复制到项目中,更名为mt19937,使用import用法导入包。

相关链接

  1. 梅森旋转算法
  2. C语言版的实现
  3. C#版本的实现
  4. Go语言版的实现

注1:C语言版默认是静态调用模式,本仓库收集整理时重构为实例化的方式调用。

注2:C#版实现用了静态写法,本仓库收集整理时重构了命名方式并改为非静态用法。

注3:Go语言版没有浮点数生成的部分,本仓库收集整理时添加了这部分代码。

mt19937's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.