Skip to content

Instantly share code, notes, and snippets.

@MerlinTwi
Created November 25, 2017 12:40
Show Gist options
  • Save MerlinTwi/94486670748d30869326518ae32e6e93 to your computer and use it in GitHub Desktop.
Save MerlinTwi/94486670748d30869326518ae32e6e93 to your computer and use it in GitHub Desktop.
Формула "честного" рандома
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