C++ & Qt: Don't pick a random number for x minutes -
let's have 10 numbers 1 10 , rand() picks number 3. number displayed on screen, but won't shown 15 minutes after picked . how can that? i know srand should used better random results, that's not want achieve. want specific number shown once, after not appear until 15 minutes gone. i've read sleep, haven't figured out how works , if fits problem. one straightforward way: keep record of numbers they're picked , time they're picked. so each time want display number: check record , remove entries older 15 minutes. pick number between 1 , 10. check record see if picked number has been used in last fifteen minutes. if go step one. since picked number hasn't been used in last 15 minutes, display number. add new entry record picked number , current time. note obviously, if pick 9 numbers in less 15 minutes, , tenth number picked within 15 minutes, result not random @ all. point being kind of constraint results less random more numbers ...