Random ones and zeros

Moderators: Disciple, zlovatt

Post Reply
SteveB
Posts: 14
Joined: February 27th, 2007, 8:45 am

Is there a simple expression (or not so simple) that randomly changes a string of ones and zeros back and forth? I've seen a few articles that sort of explain this, but they're much more involved than I need.
User avatar
Atomic
Posts: 157
Joined: April 30th, 2007, 5:55 am
Location: United States, Ohio

Isn't there an animation preset for doing that with text?
"Up And Atom

No...No

Up And At Them!"
SteveB
Posts: 14
Joined: February 27th, 2007, 8:45 am

I looked, but wasn't able to find one.
SteveB
Posts: 14
Joined: February 27th, 2007, 8:45 am

Thanks Atomic, but I've finally found a solution on the Creative Cow forum:
http://forums.creativecow.net/readpost/2/930650
Thanks to Darby Edelen.
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

I tried making a text layer with a row of zeros, adding a Wiggly selector and setting the Character Offset to 1, but this caused the numbers to switch between 0,1 and 9.
EDIT: As explained in the Creative Cow post mentioned above, you need to change the Min Amount value from -100 to 0 for this to work.

Alternatively, here's an expression you can apply to a text layer's Source Text property:

Code: Select all

framesPerSecond = 25;
numberOfCharacters = 10;

posterizeTime(framesPerSecond);
result = "";
for (x=1; x <= numberOfCharacters; x++) {
	result += Math.round(random(0,1));
}
result;
SteveB
Posts: 14
Joined: February 27th, 2007, 8:45 am

Thanks. That seems to work real well, too.
Post Reply