Created
November 25, 2017 12:40
-
-
Save MerlinTwi/94486670748d30869326518ae32e6e93 to your computer and use it in GitHub Desktop.
Формула "честного" рандома
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
current_chance = (max — goods) / (length — tries) | |
max=сколько нужно выдать игроку предметов | |
length=на количество попыток (max=1, length=10: на 10 попыток один предмет, т.е. шанс 10%) | |
goods=сколько уже выпало предметов | |
tries=номер попытки (как только tries становится равным length, всё начинается заново) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment