• Got a Tipila, google, windows live or facebook account ?

Not suited for all situations, but this is the most efficient, super fast flip flop mechanism.

array = [yellow, red] // alternative colors
len = 2 // length of array
loop from 1 to n
 print array[i%len] // alternate through the colors
end loop

Tipila is a site for programmers to save interesting things found on the web, as Tips.

No more wasting time by re-googling for things you've found but forgotten.

It's totally free...
Get started now

Login to Tipila