AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

I need a simple code

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
me10c



Joined: 22 Nov 2008
Posts: 44

PostPosted: Sat Jul 18, 2009 6:13 pm    Post subject: I need a simple code Reply with quote

Can someone do this one for me please (yeah, I know, I am lazy)

80% chance to choose (if it doesnt choose add 0)
choose a number between 12-92 (including 12 and 92)
repeat 100 times
find the average number
ex (with 10 numbers) 0 12 0 92 10 15 54 24 0 33 = 24 average
Back to top
View user's profile Send private message
Matas



Joined: 07 Mar 2009
Posts: 49
Location: Europe, Lithuania

PostPosted: Sat Jul 18, 2009 6:19 pm    Post subject: Reply with quote

Your English is awful.. Can't understand what u want Laughing
Back to top
View user's profile Send private message
me10c



Joined: 22 Nov 2008
Posts: 44

PostPosted: Sat Jul 18, 2009 6:22 pm    Post subject: Reply with quote

step 1 : 80% chance to generate a number. If it doesnt generate a number add 0.
step 2 : Generate a number between 12 and 92 (including them)
step 3 : Repeat step 1 and 2 100 times
step 4 : Show the average number (you saw the example)

how hard is to understand that o.O
Back to top
View user's profile Send private message
Matas



Joined: 07 Mar 2009
Posts: 49
Location: Europe, Lithuania

PostPosted: Sat Jul 18, 2009 6:57 pm    Post subject: Reply with quote

here u are, lazy guy.. Very Happy

Code:
loop, 100
{
Random, chance, 1, 100
if chance > 80
Number = 0
Else
Random, number, 12, 92
sum += %number%
}

average := sum / 100
MsgBox, %average%
Back to top
View user's profile Send private message
me10c



Joined: 22 Nov 2008
Posts: 44

PostPosted: Sat Jul 18, 2009 7:36 pm    Post subject: Reply with quote

I didnt knew how to make the
Code:
Random, number, 12, 92
sum += %number%
}

average := sum / 100
MsgBox, %average%
Back to top
View user's profile Send private message
RTFM.
Guest





PostPosted: Sun Jul 19, 2009 6:25 pm    Post subject: Reply with quote

Quote:
I didnt knew how to make the ...
Well, next step should be to use a more meaningfull subject line for your next thread at the forum. Good luck Cool
Back to top
Matas



Joined: 07 Mar 2009
Posts: 49
Location: Europe, Lithuania

PostPosted: Wed Jul 22, 2009 4:13 pm    Post subject: Reply with quote

me10c wrote:
I didnt knew how to make the
Code:
Random, number, 12, 92
sum += %number%
}

average := sum / 100
MsgBox, %average%


Now you know. Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group