宾果游戏RNG最常用的算法是什么? [英] What is the most used algorithm for bingo's RNG?

查看:144
本文介绍了宾果游戏RNG最常用的算法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正处于研究阶段,但不幸的是,我似乎找不到任何有关BINGO游戏最常用算法的线索。



我尝试了什么:



我试过搜索谷歌学者和代码项目但仍然没有线索......我只能找到是RNG这个词,但没有具体说明使用什么RNG。

I'm in a middle of reasearch but unfortunateley, I can't seem to find any clues on what is the most used algorithm for the BINGO game.

What I have tried:

I've tried searching Google scholar and Code Project but still no clues... all i can find is the word RNG but no specifically saying what RNG is used.

推荐答案

取决于您使用的语言和环境 - 大多数系统都提供内置的随机数生成器。既然你标记了这个C ++和C#,我将给你一个C#的例子(因为它也直接适用于某些C ++)

Depends on what language and environment you are using - most systems provide a built in random number generator. Since you tagged this C++ and C#, I'll give you an example for C# (as it's directly applicable to some C++ as well)
private Random rand = new Random();
...
int randomValue = rand.Next(0, 100);  // Fetches a number between 0 and 99 inclusive



对于Bingo模拟器,我会设置一个 List< int> ,其中包含您可以调用的每个可能的数字,并使用随机实例获取索引。一旦我在该索引处获取了该数字,我就将其从列表中删除,以便它不能在同一游戏中重复。


For a Bingo simulator, I'd set up a List<int> with each of the possible numbers you can call, and use the Random instance to get an index into that. Once I'd fetched the number at that index, I'd remove it from the List so it can't be repeated in the same game.


这篇关于宾果游戏RNG最常用的算法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆