Логин: Пароль:
Регистрация нового пользователя
Модератор: 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).

Дата и время
Друзья в сети
Любимые форумы
Клубы
Советы
Копирайт © 2002 - 2024 Филип Рахунек, все права зарезервированы.
Наверх