Created
April 9, 2013 12:32
-
-
Save aviaryan/5345338 to your computer and use it in GitHub Desktop.
Generate Random numbers based on user input
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;Random Number Generate | |
;Avi | |
MsgBox, 36, Choose, Yes for A`, No for B | |
IfMsgBox yes | |
{ | |
loop, | |
{ | |
StringRight,rightest,a_tickcount,1 | |
if rightest in 1,2,3,4,5 | |
{ | |
randomnumber := rightest | |
break | |
} | |
} | |
} | |
IfMsgBox, No | |
{ | |
loop, | |
{ | |
StringRight,rightest,a_tickcount,1 | |
if rightest in 6,7,8,9 | |
{ | |
randomnumber := rightest | |
break | |
} | |
} | |
} | |
MsgBox, 64, Result, The random number generated was %randomnumber% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment