用户名: 密码:
新用户注册
监管者: SueQ , coan.net 
 Backgammon

Backgammon and variants.

Backgammon Links


讨论板列表
状态: 所有人能发表
帖子搜索:  

19. 十月 2012, 14:39:51
playBunny 
题目: Re:
Walter Montego: ~~I do not understand your programming code listed

That's not my code, that Aganju's post. Fortunately it's not necessary to understand it unless you have reason to tweak it. Most programmers treat random number generators as a black box. "Give me a random number" is all that needs to be understood.

At DailyGammon the dice generation is taken to extra lengths. The RNG uses a library routine, such as the one that Aganju showed, but it also uses physically generated random numbers from random.org, which provides values generated from atmospheric radio noise. But even then, the programmer doesn't care how the calculated numbers are actually calculated. He calls the black box for one random number, gets another from random.org and combines them. In this way, any biases in either source are removed by the randomness of the other.

~~why is it that the first number generated is not random? This was something I had a teacher tell me forty years ago. It is still the case?

It's never been the case as far as I'm concerned but my programming only goes back thirty years. Even so, I'm surprised at what your teacher said. If he was correct then the solution is as simple as you suggested.

~~why start each roll over in a game? Why not just pick say 200 numbers and store them until needed for each game.

This doesn't produce any more randomness that calculating the numbers one at a time. As it requires storage and extra programming there needs to be a distinct advantage. It would also take more time, although that's not a huge consideration on modern hardware. Whatever length of buffer you had, you'd be generating more rolls than you need and throwing the unused ones away at the end. (Using them in another game just adds more programming effort and complexity).

日期和时间
在线的朋友
最喜欢的讨论板
朋友群
每日提示
Copyright © 2002 - 2024 Filip Rachunek, 版权所有
回顶端