Jump to content

how to use random..


zutto
 Share

Recommended Posts

Here you go !!! I did it!!!

$value = Round(Random(Random(1, 2, 1), Random(1, 2, 1), Random(-1, 0, 1)), 0)
FileWrite(@ScriptDir & '\Random' & Round(Random(Random(1, 2, 1), Random(1, 2, 1), Random(-1, 0, 1)), 0) & '.txt', _
"Random: " & Round(Random(Random(1, 2, 1), Random(1, 2, 1), Random(-1, 0, 1)), 0))
While 1
    $read = FileRead(@ScriptDir & '\Random' & Round(Random(Random(1, 2, 1), Random(1, 2, 1), Random(-1, 0, 1)), 0) & '.txt')
    If @error = 1 Then
        ;
    Else
        $ai_SRE = StringRegExp($read, ": ([0-9]*)", 1)
        MsgBox(0, "",  StringMid("-+",Random(1,2,1),1) & (($ai_SRE[0] * Random(2, 5, 1)) + Random(1, 8, 1)))
        ExitLoop
        
    EndIf
    
WEnd
This code is horrid.

1.

$value = Round(Random(Random(1, 2, 1), Random(1, 2, 1), Random(-1, 0, 1)), 0)

This allows for the possibility of the Min parameter to be greater than Max which will return zero.

2.

Random(-1, 0, 1)

You use the result of this call as the 3rd parameter for Random(), but this flag is meant to be between 0 and 1.

3.

$value = Round(Random(Random(1, 2, 1), Random(1, 2, 1), Random(-1, 0, 1)), 0)

You are calling Round with a zero flag which casts your random to int, why not just force the int flag on Random()?

Link to comment
Share on other sites

This code is horrid.

1.

$value = Round(Random(Random(1, 2, 1), Random(1, 2, 1), Random(-1, 0, 1)), 0)

This allows for the possibility of the Min parameter to be greater than Max which will return zero.

2.

Random(-1, 0, 1)

You use the result of this call as the 3rd parameter for Random(), but this flag is meant to be between 0 and 1.

3.

$value = Round(Random(Random(1, 2, 1), Random(1, 2, 1), Random(-1, 0, 1)), 0)

You are calling Round with a zero flag which casts your random to int, why not just force the int flag on Random()?

Meh. Evaluate this one for me then?

(Sorry, this is my last post ;) )

#include <Math.au3>

$random = Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), Random(Random(Random(Random(0,1,1), 2, 1), _
Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), _
Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), Random(Random(Random(Random(0,1,1), 2, 1), _
Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), _
Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), 1) + 5 + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), Random(Random(Random(Random(0,1,1), 2, 1), _
Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), _
Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), Random(Random(Random(Random(0,1,1), 2, 1), _
Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), _
Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), 1) / 2 + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), Random(Random(Random(Random(0,1,1), 2, 1), _
Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), _
Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), Random(Random(Random(Random(0,1,1), 2, 1), _
Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), _
Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), Random(Random(Random(Random(0,1,1), 2, 1), _
Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), _
Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), Random(Random(Random(Random(0,1,1), 2, 1), _
Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), _
Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), 1) + 5 + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), Random(Random(Random(Random(0,1,1), 2, 1), _
Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), _
Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), Random(Random(Random(Random(0,1,1), 2, 1), _
Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), _
Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), 1) / 2 + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), Random(Random(Random(Random(0,1,1), 2, 1), _
Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), _
Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), Random(Random(Random(Random(0,1,1), 2, 1), _
Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), _
Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), 1)

$random2 = Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), Random(Random(Random(Random(0,1,1), 2, 1), _
Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), _
Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), Random(Random(Random(Random(0,1,1), 2, 1), _
Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), _
Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), 1) + 5 + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), Random(Random(Random(Random(0,1,1), 2, 1), _
Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), _
Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), Random(Random(Random(Random(0,1,1), 2, 1), _
Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), _
Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), 1) / 2 + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), Random(Random(Random(Random(0,1,1), 2, 1), _
Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), _
Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), Random(Random(Random(Random(0,1,1), 2, 1), _
Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), _
Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), Random(Random(Random(Random(0,1,1), 2, 1), _
Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), _
Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), Random(Random(Random(Random(0,1,1), 2, 1), _
Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), _
Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), 1) + 5 + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), Random(Random(Random(Random(0,1,1), 2, 1), _
Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), _
Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), Random(Random(Random(Random(0,1,1), 2, 1), _
Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), _
Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), 1) / 2 + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), Random(Random(Random(Random(0,1,1), 2, 1), _
Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), _
Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), Random(Random(Random(Random(0,1,1), 2, 1), _
Random(0,1,1), 1) + 1, 2, 1), 1) + Random(Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), _
Random(Random(Random(Random(0,1,1), 2, 1), Random(0,1,1), 1) + 1, 2, 1), 1)


$timer = TimerInit()
Sleep(Random(500, 1000))
$diff = TimerDiff($timer)
$Value = BitAND(BitShift($random, Random(-2, 4, 1)), $random2)
$Value2 = StringLeft(($value * $value) / _Radian(Exp(Sqrt(3.14159265358979))) + Dec(Hex(Int($diff))), 1) / StringLeft(($value * $value) / _Radian(Exp(Sqrt(3.14159265358979))) + Dec(Hex(Int($diff))), 1)
$Value3 = $Value2 + Random(-1, 0, 1)
If "Chicken" < "Egg" Then $Value3 += 1
If "Smoke_N" > "Jos" Then $value3 -= 1
    
MsgBox(0, "", $Value3)
Link to comment
Share on other sites

  • Developers

Ok folks, I know I more or less started this but lets get back on topic.

The OP will need a day just to go through this thread ;)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...