Solved How to do random chance in terms of numbers?

December 16, 2016 at 12:15:31
Specs: Windows 10 , Intel i7-4790 3.60 GHz / 8 gigs
Hey, I was wondering, how would I go about setting up a random chance for a number between 1 and 1,024? In a batch program, I mean.

See More: How to do random chance in terms of numbers?

Reply ↓  Report •


#1
December 16, 2016 at 17:31:40
✔ Best Answer
set /a result=%random% %% 1024+1
echo %result%
::------ end snip
Although this is technically incorrect since your description specified "between 1 and 1024, which would of course only include the numbers 2 thru 1023. I will assume you meant "from 1 to 1024". If this nit-picking seems anal, think about what an error like this could mean for your space-shuttle mission! Or your stock options!

message edited by nbrane


Reply ↓  Report •

#2
December 19, 2016 at 19:41:22
Haha, I know, it's not anal. :)
But yeah, sorry for being a little vague I guess...^^
But thanks!! This is very helpful.

Reply ↓  Report •

Related Solutions


Ask Question