forum.boolean.name

forum.boolean.name (http://forum.boolean.name/index.php)
-   Blitz3D (http://forum.boolean.name/forumdisplay.php?f=45)
-   -   Сингулярное состояние ГПСЧ (http://forum.boolean.name/showthread.php?t=8607)

impersonalis 04.07.2009 15:50

Сингулярное состояние ГПСЧ
 
Читаем хелп по
Код:

SeedRnd seed
Цитата:

Computer random number generators are not truly random. They generate numbers based on a seed value (an integer number). If you 'seed' the random number generator with the same seed, it will always generate the same set of numbers. Use this command to ensure you get a good set of numbers. Usually you set the seed value to a timer or system clock value to ensure that each time the program is run, a new value is seeded. Look at the example for normal usage of this command.
Нигде я не вижу ограничений на параметр seed, однако:
Код:

SeedRnd(-1)

For i=1 To 10
        DebugLog LSet(Str(Rand(100)),10)+Str(Rnd(100))
Next

Результат:
Цитата:

1 99.9992
1 99.9992
1 99.9992
1 99.9992
1 99.9992
1 99.9992
1 99.9992
1 99.9992
1 99.9992
1 99.9992
Любой другой параметр (включая отрицательные и 0) работает кооректно.

SBJoker 04.07.2009 15:53

Ответ: Сингулярное состояние ГПСЧ
 
Видимо это отключает генератор :)

ABTOMAT 05.07.2009 00:48

Ответ: Сингулярное состояние ГПСЧ
 
Я уж думал, что уже все недокументированные функции старичка блица нашли и описали, а вот поди ж ты...


Часовой пояс GMT +4, время: 09:30.

vBulletin® Version 3.6.5.
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Перевод: zCarot