For the Love of Random

December 13, 2011

By Tad Fry

Random is one of my favorite creative weapons. Although a major goal of design is to assign meaning to elements, the slightly haphazard road created by random can spark quite a brainstorm during your creative process. If you find yourself stuck on a project, then roll the dice to keep moving forward.

My obsession began when I couldn’t decide which action to do next on my Next Actions list. All priorities were equal, and I was wasting time debating on which item to complete. So, I rolled the dice and the decision was made for me. Yes, I’m aware this was ridiculous, but it was fun and kept me moving. Not to mention, I couldn’t wait to complete the task so I could roll again.

Now, if you’re like me, your Next Actions list is well over a dozen items. We must not leave out the tasks after the twelfth item; therefore, (yes, I know I’m insane), I wrote code that will give a random number from one to a max number I input using mt_rand. My glorious random machine was working, but something bothered me. How in the world did mt_rand do its job? Considering programming is so binary, how did it give me a random number? I learned it’s pseudo-random. Upon putting that knowledge in my brain, I attempted to write my own random function, but for now it’s just heads or tails. I might expand it a bit, but I like its simplicity and that I made it without using a library. If I need anything more than a coin flip, I’ll use mt_rand.

Aside from taking care of my insanity, there’s other fun uses with random. As you’re sketching, roll a random number to decide how many limits you are going to force with how many points, lines, planes, shading, or texture you get to use. Draw some monsters, and roll to figure how many eyes, mouths, and legs are going to be on it.

A more practical approach is to use mt_rand, array_rand, or MySQL RAND(), to pull in different content to your website. Appropriate content could be a homepage image, testimonials, quotes, facts, and tweets. I wouldn’t apply random to your navigation because it might annoy users. But adding random to some of your other elements can make your website live; an amazing-living-random creature.

I hope you’ll add some random to your next project, or at least during your creative process. If you do, then please share your progress with me on Twitter, @tadfry. I’d love to see your work. My next project is heavily based on random, and I can’t wait to release it!