Jump to content
Sign in to follow this  
goldenix

[Solved]_Random(1,1,1)

Recommended Posts

goldenix

I want the code to generate randomly the same number. but its not working.

while 1
    
    $a = Random(1,1,1)
        
    ConsoleWrite ($a & ' ')

    If $a = 0 then  MsgBox(0,'',$a)
    
WEnd
Edited by goldenix

My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]

Share this post


Link to post
Share on other sites
Manjish

What is it that u want to do.. i kinda agree with trancexx..


[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com

Share this post


Link to post
Share on other sites
goldenix

What is it that u want to do.. i kinda agree with trancexx..

An experiment.

I want to generate randomly the same number in an infinite loop & then use my psychokinetic abilities to make the computer generatea number Zero.

That was the plan,

But I have my doubts now, maybe I should let the code do infinite random 0 & 1 generations & then try to force the computer to generate more zeros at constant rate by using my mind.

But I dont know how to read how many lines are in the file, is there already built in function to read a nr of lines in a file?

This is what I have so far:

#Include <Misc.au3>

$dll = DllOpen("user32.dll")

while 1
    
    For $x=1 to 100000
        $a = Random(0,1,1)

            If $a = 0 Then  filewriteline('0.txt',$a & @CRLF)
            If $a = 1 Then  filewriteline('1.txt',$a & @CRLF)

        If _IsPressed("78", $dll) Then ExitLoop ; F9 to exitloop

    Next

;~ compare wich filehas more lines in it

;~  ConsoleWrite (0 or 1 wins & @CRLF)  

WEnd
DllClose($dll)
Edited by goldenix

My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]

Share this post


Link to post
Share on other sites
Xand3r

While 1
    $rnd=Random(0.1,1.000000001)
    $rnd1=Ceiling($rnd)
    ToolTip($rnd,0,0)
    If $rnd1=2 Then MsgBox(0 , "OMG" , "WoW you have pk :))")
WEnd

although it should be possible it's virtually impossbile to do it :)

Edited by TheMadman

Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

Share this post


Link to post
Share on other sites
weaponx

If this topic was meant to be a joke, its not very funny.

Share this post


Link to post
Share on other sites
goldenix

If this topic was meant to be a joke, its not very funny.

Why would anyone assume this is a joke? Im trying to see if I can make the computer generate more 0 than 1 & see what will happen.

So there is no built in finction to read total amount of lines in a file?


My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]

Share this post


Link to post
Share on other sites
Paulie

Why would anyone assume this is a joke? Im trying to see if I can make the computer generate more 0 than 1 & see what will happen.

So there is no built in finction to read total amount of lines in a file?

_FileCountLines()

I don't quite understand your point, however...

Share this post


Link to post
Share on other sites
Xand3r

try your pk abilities on my example :)


Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

Share this post


Link to post
Share on other sites
goldenix

_FileCountLines()

I don't quite understand your point, however...

Thanx I finished my code, Ill share it under sample scripts section.


My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.