"Von Neumann" is named in honor of mathematician and physicist John Von Neumann, whose "middle-square" pseudorandom number generator powers the engine used in this installment.
In computer programming, nothing is completely random, it's all pseudorandom. That is, to create a "random" number, you feed a number into a formula and the result is your random number. Usually, computer functions such as Math.random()
use the current date (including milliseconds) to feed to their random formula, and this is random enough. Yet technically, if you knew the formula, and the number fed to this formula (seed), you'd know the result.
In the case of this August installment, I wanted a random engine which I could feed a specific number, and it would always return the same random-looking number (if fed the same seed). I would use the pseudorandom product to scale, rotate, place and color various shapes in a space, creating pseudorandom artwork.
Middle-Square
Von Neumann came to the rescue with his middle-square method which is extremely easy to work with; quite simply, you square a 4 digit number, and choose the 4 middle digits of the end result.
11112 = 1234321 -> 3452
More elaborate PRNGs have been created, but the simplicity of this middle-square method, and the visual results were exactly fine for my purpose.
Result
The end result will replicate some pre-drawn shapes a specific number of times, then proceed to rotate them, scale them, animate them, position them and finally color them according to a color array I choose. All of this based on what random-seed the engine is fed. You can either enter this 4-digit random seed in the upper-left textbox, or you can drag the crosshair to use its coordinate to generate a seed for you.
In the next couple of months, I hope to elaborate this engine, add restraints, remove other restraints and generally see where it'll take me. Art happens all the time.
15 responses to “August ’06 Installment: Von Neumann”
5243 on configuration 5.
Very interesting concept. Can’t wait to see where you go with it.
[…] Check out Joen’s August Installment: Von Neumann for some pretty nerd-candy. The name should be familiar to any computer science student. […]
Chris said:
Yep, that one turned out pretty lucky! Thanks.
Jonas Rabbe said:
Me neither ๐ and thanks.
Impressive stuff! I’m liking these more interactive installments, but I also miss the beautiful photography of the static installments..
Joen, this is really cool! Its like one of my projects for CS, but on steroids! Can’t wait for more.
Nik said:
Thanks Nik, I appreciate it. As for one versus the other… I think the static photography stuff can actually be combined with such an engine.
Sid said:
Thanks. Do you have a link for your projec?
Joen, I’ll have to look and see, but from what I remember I used a K2 type generator to very randomly pick cards from a deck for some black jack. No where near as cool as yours ; ) but I made custom cards using Graphics2d, only the best of vector graphics for mua ๐
I had to look up “K2”, I kept thinking about the WordPress Theme…
K2:
Is that correct? If so, very impressive, and certainly more random than the middle-square one.
Haha, I realised after I had comment that confusion would happen ๐ As for you question, yes sir, Thanks!
Wow, very cool! ๐ฎ
I like it. Also, looks very good as a background image.
Sebastian Schmieg said:
Thanks. I should compile some of them into wallpapers, actually… not a bad idea.
Extremely good! Your artistic talent keeps amazing me! Thumbs up!
Thanks a lot, I appreciate that.