Jump to content

Genius Idea For a Script


 Share

Recommended Posts

i was reading what WideboyDIxon said up above about Pi, and i was thinking, can you get the computer to display out Pi, and continuely caluclate it?

$pi = 4 * ATan(1)

;then

Echo ("$pi")

?

is echo even a command?

Your used to batch arent you?

MsgBox(0, PI, $p)

I'm new to AutoIT, please help me where you can.[size=10]Profanity is the one language that all programmers understand[/size]

Link to comment
Share on other sites

  • Replies 63
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

$pi = 4 * ATan(1)

MsgBox(0, 0, $pi)

thats pretty cool, thanks for that!

how do you get it to show more than just that? is there anyway it can calculate on forever (!?)

Ofcourse there is. See "Calculating π" part in the wiki page about pi.

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

How would you calculate all possible combinations of pixels (brute force the picture)?

I started thinking abou tit.. and i can't find a way to put it into loops :S

Edited by dexto
Link to comment
Share on other sites

It might be more complicated that i imagined at first?

and its not working for me:

Func _CreateRandomBitmap($hWnd, $iWidth, $iHeight)
    Local $numb = 0xFF000000, $x = 1, $y = 1, $i = 0, $k = 0
    Local $iI, $iSize, $tBits, $tBMI, $hDC, $hbmp, $iRow, $iW = 0, $iH = 0
    $iSize = $iWidth * $iHeight
    $tBits = DllStructCreate("int[" & $iSize & "]")
    While $i < $iSize
        For $iI = 0xFF000000 To 0xFFFFFFFF Step 0x5
            DllStructSetData($tBits, 1, $iI, $i)
        Next
        $i = +1;position move up
    WEnd
    $tBMI = DllStructCreate($tagBITMAPINFO)
    DllStructSetData($tBMI, "Size", DllStructGetSize($tBMI) - 4)
    DllStructSetData($tBMI, "Planes", 1)
    DllStructSetData($tBMI, "BitCount", 32)
    DllStructSetData($tBMI, "Width", $iWidth)
    DllStructSetData($tBMI, "Height", $iHeight)
    $hDC = _WinAPI_GetDC($hWnd)
    $hbmp = _WinAPI_CreateCompatibleBitmap($hDC, $iWidth, $iHeight)
    _WinAPI_SetDIBits(0, $hbmp, 0, $iHeight, DllStructGetPtr($tBits), DllStructGetPtr($tBMI))
    _WinAPI_ReleaseDC($hWnd, $hDC)
    Return $hbmp
EndFunc  ;==>_CreateRandomBitmap
Link to comment
Share on other sites

well random generation of the pixel is not going to get any picture that is for sure.. (just static) because just the fact its random is not going to give any pattern. so... there is a brute force approach to cracking the passwords that tries all possible combinations of the letters and numbers, same can be applied here. (for small pictures, preferably B&W)

Every pixel could be changes one by one so that all possible combinations of pixels achieved. (for B&W imagine very large binary number that from 00000.... to 111...... displaying the result in B&W pixels)

Edited by dexto
Link to comment
Share on other sites

Well really, a random combination of pixel colors would, if ran for infinity, show every image ever made, not made, thought of, what ever. You'd be more likely to see variations of known images then the actual image 100% correct. If you could look at all the images for eternity, you would see the Mona Lisa an infinite number of variations. And only one correct. Probably the most difficult part with doing it random then changing pixel by pixel is, when you change pixel by pixel, you know you won't get the same combination again. With random you could potentially have an infinite variations of the Mona Lisa and 3 perfect copies. Unless you had a method of making sure that the same image wasn't displayed more then once, which I believe after a few would slow todays computers down, let alone when you get to the 1,000,000,000,000,000,000th image.

Giggity

Link to comment
Share on other sites

It's like flipping a die with infinite sides. If you flip a coin, you have a 50/50 chance of getting heads. If you flip your infinite sided die, you have a 1:infinity chance that the pixels will be the proper color to create Mona Lisa. If each pixel is determined by picking a random color in the range of visible colors at some point Mona Lisa would appear. It may be long after the Universe stops existing but it would happen at some point.

Giggity

Link to comment
Share on other sites

the mistake commonly made is that you imagine a picture associated with a word random while talking about random pixel. these are two different things. key problem with that is uniform distribution of random numbers that is a part of the definition of the random number that can only be defined do be random relatively to other number set.

example:

write a program that that generates randomly number from 1-6 and loop it 1000 times display the number of times 1 being generated 2,3,4,5,6. you will find out that there are almost identical. so... random number sets are NOT random! (common misconception)

Edited by dexto
Link to comment
Share on other sites

It is long time ago that I dealed with combinatorics and I may be wrong:

E.g if you have 3 different balls with different colors than you have 3! = 6 possibilities to arrange them.

Now if you have pixels instead of balls and your screen resolution is e.g. 200x200 then you have (200x200)! combination. If you going to add the colors for each pixel

e.g. grey -> 2^8 per channel then you will have a giant number of combination.

I've no time to check combinatoric theorems again to give you an exact mathematical example ^_^

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

the mistake commonly made is that you imagine a picture associated with a word random while talking about random pixel. these are two different things. key problem with that is uniform distribution of random numbers that is a part of the definition of the random number that can only be defined do be random relatively to other number set.

example:

write a program that that generates randomly number from 1-6 and loop it 1000 times display the number of times 1 being generated 2,3,4,5,6. you will find out that there are almost identical. so... random number sets are NOT random! (common misconception)

Your example would be the limitations of the Random function built into auto it. Yes I have seen the limitations of this. but a classic example would be Pi. Pi never comes to a pattern. But if you follow Pi out infinitely, Every combination of numbers will be represented. Somewhere in Pi will be 5,000,000,000,000. Somewhere in Pi is the Hexadecimal combination for the Mona Lisa ^_^ (have to use her again). Yes, there are mathematical equations for Pi so it is not technically Random, but seeing it never forms a Pattern, it is random enough for me. The word Random expresses making a decision which a computer can not decide without an equation between a set of numbers. And if you think about it Random doesn't truly exist. If you're on Wheel of Fortune, and you spin the wheel, the outcome is not random. It's based on where you started + force - Friction. If someone tells you to draw a card, I guarantee there is a mathematical equation that fires in your brain that tells you what card to pick. It'll involve all surrounding elements.

Giggity

Link to comment
Share on other sites

Well its not so much limitation as what is supposed to be. Requirement for a random number is that at any given try every number has even chance to be a result. Pi is not following that.

think of a music... notes arranged in a pattern, compare it with random notes and insturments (noise) that is the random picture generator is in comparison.

what i am proposing is to make binary counter with [width]*[height] places and count from 0 to largest representing each number in B&W picture 100x100

and that is where i fail miserably in lack of imagination.

imagine there are ONLY 100 mil combination possible! you will definitely see all possible B&W pictures 100x100

people with better coding imagination help! ^_^

Link to comment
Share on other sites

@UEZ

I think that is called permutation. In our case i think it should be calculated as [colors]! not [pixels]! And it can't really be applied here. unless #colors = #pixels. I calculate it as pixels^colors i think that is right... (200x200)^2 = 1 600 000 000 possibilities. That is just for 2 colors. :S

Link to comment
Share on other sites

Amazing that this thread has gone 5 pages! lol

Um, wouldn't just a simple 5x5 B&W grid have 33,554,432 possibilities?

I wrote a simple brute-force serial cracker when I was a kid and remember getting up the next morning to find it was like .00000001 complete. I think I figured it would take a couple decades to complete.

Edit: I think the formula is 2^5*2^5, not 5^2*5^2. So 2^200*2^200 would take a lifetime to run.

Edit2: I'll go with (2^5)^5 or (2^X)^Y ?

Edit3: I've been out of school for too long1

Edited by Spiff59
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...