jonathanpenn / ui-auto-monkey

UI AutoMonkey is a simple stress testing script for iOS applications that runs in UI Automation and Instruments. Grass fed. Free range.
http://cocoamanifest.net
MIT License
1.47k stars 249 forks source link

the random algorithm has an error #31

Open sixleaves opened 8 years ago

sixleaves commented 8 years ago

in your code, there is a random algorithm, Math.floor(Math.random() * (max -min )) +1; this can't produce correctly random number [a, b].

there is a correctly method, Math.floor(Math.random() * (max -min + 1)) + min;