Help! Binary random 1's & 0's in AE


#21

Felt,



Thank you for sharing! looks very usefull.



Best regards,

Andrey


#22

The thread that rose from the dead!

No worries. :slight_smile:


#23

felt, you are an absolute wealth of knowledge. I needed some quick binary code, and remembered seeing this thread awhile ago. Thanks for the huge time saver!!!


#24

Hi! I can’t get this to work. I realize this is a 7 year old post, but anyway: CC 2018 tells me there’s an error in line 9 (“expected: ;.”) There’s semicolons at all the right places AFAIK. I’m trying the last variant of the expression listed here. Any tips?


#25

Hi, it looks like the forum messed with the posts and removed parts of the code. The code is not complete in the last post by felt_tips, so it won’t work.

Try the code from felt_tips first reply in this thread, that looks correct to me at first glance.*

Kind regards,
Tobi

*at second glance it looks like felt mixed up lines height and width, so tX does control the amount of lines, not tY. Didn’t try it out as I’m not on my workstation, but it reads to me as if these are mixed up.


#26

@Creattive is right, last expression is broken.
Here is working version of it:

tX = 44; //chars per line
tY = 16; //no of lines
tChangesPerSecond = 3.1; //how often a new random is generated

posterizeTime( tChangesPerSecond );

tText = ""; //initialise text

for ( j = 0; j < tY; j++ ){  //loop thru lines
    for ( i = 0; i < tX; i++ ){

        tText += (( random() > 0.5 ) ? "1" : "0" );
    }
     tText += "\r"; //add line break
}

[ tText ]

#27

Thank you very much! This works.