Random function

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
rockitdontstopit
Posts: 71
Joined: 12 Nov 2022, 15:47

Random function

Post by rockitdontstopit » 08 Jun 2023, 08:18

I know the "Random" function creates a pseudo-random number. If I set the range from 1 to 10 and then execute something when the generated number is 5 or less, will the execution occur at a rate of 50%? Just making sure.

BigBrainAFK
Posts: 6
Joined: 20 May 2023, 15:29
Contact:

Re: Random function

Post by BigBrainAFK » 08 Jun 2023, 08:45

This is something you can just test quickly by yourself. just loop like 100.000 times and in the loop generate a random number and then store if its below 5. after the loop is done print the stored times it was below 5 and you would know the percentage. could even have ahk calculate the percentage. if you wanna be really save you do a few million loop iterations

Post Reply

Return to “Ask for Help (v1)”