当前位置:网站首页>[oops framework] random number generation management
[oops framework] random number generation management
2022-07-26 00:38:00 【dgflash_ game】
Functional specifications
OopsFramework- Random number generation management module , Encapsulates the seedrandom Third party random database
Instructions
Set random seeds
// Random seeds can be sent by the server to other clients , The same seed , When multiple terminals are random for the same number of times , The result is the same
RandomManager.instance.setSeed(123456789);
Generates a random integer in a specified range
var min = 1;
var max = 10;
// [min,max) Get a random integer between two numbers , This value is not less than min( If min If it's not an integer , Get a rounded up min), And less than ( But not equal to )max
RandomManager.instance.getRandomInt(min, max, 1);
// [min,max] Get a random integer between two numbers , Including two numbers , This value ratio min Big ( If min Is not an integer , That's not less than min Big integers ), But less than ( But not equal to )max
RandomManager.instance.getRandomInt(min, max, 2);
// (min,max) Get a random integer between two numbers
RandomManager.instance.getRandomInt(min, max, 3);
According to the maximum value , The minimum range generates an array of random numbers
var min = 1;
var max = 10;
var n = 10;
// Generate 10 individual 1~10 An array of random numbers between
RandomManager.instance.getRandomByMinMaxList(min, max, n);
Get random objects in the array
var objs = [1,2,3,4,5,6,7,8,9]
RandomManager.instance.getRandomByObjectList(objs, 3);
Fixed sum random assignment
// Random 5 It's an integer ,5 The sum of the numbers is 100
RandomManager.instance.getRandomBySumList(5,100);
边栏推荐
- Trial division -- power of 3
- HCIP 第十一天
- 使用LocalDate类完成日历设计
- Solve page refresh without attaching data
- Quick start sequence table chain table
- HCIP第十二天
- Pikachu target clearance and source code analysis
- Nodejs starts mqtt service with an error schemaerror: expected 'schema' to be an object or Boolean problem solving
- 2022/7/24 考试总结
- How much data can a list store?
猜你喜欢
![[hero planet July training leetcode problem solving daily] 25th tree array](/img/e6/a59a1719c4381772ce7475d59d5068.png)
[hero planet July training leetcode problem solving daily] 25th tree array

【无标题】如何实现可插拔配置?

BGP 综合实验

MPLS experiment

Super super super realistic digital people! Keep you on the air 24 hours a day

寻找命令find和locate

进程与线程

Verilog grammar basics HDL bits training 05

分布式事务和Seata的AT模式原理

PC website realizes wechat code scanning login function (II)
随机推荐
Research on the integrated data quality management system and technical framework under the scenario of data circulation and transaction
Semaphore
Preparation of bovine serum albumin modified by low molecular weight protamine lmwp/peg-1900 on the surface of albumin nanoparticles
BGP 综合实验
Day06 MySql知识点总结
使用CMake编译OpenFoam求解器
Distributed transactions: the final consistency scheme of reliable messages
GOM和GEE引擎黑屏不显示界面,装备地图怪物的解决方法
Verilog grammar basics HDL bits training 06
牛血清白蛋白修饰牛红细胞超氧化物歧化酶SOD/叶酸偶联2-ME白蛋白纳米粒的制备
JVM Tri Color marking and read-write barrier
8个小妙招调整数据库性能优化,yyds
YOLOV3
Introduction of MySQL transactions
融合聚类信息的技术主题图可视化方法研究
SQL server failed to send mail, prompting that the recipient must be specified
找出单身狗(力扣260)
【oops-framework】界面管理
mysql事务的引入
Quick start sequence table chain table