Simulate a Cyclic Tag System
Haskell, 55 53 51
(t:w)%p|t=w++p|0&lt;1=w
x%_=x
e w=(!!).scanl(%)w.cycle

this uses True as 1 and False as 0.
example run:
*Main&gt; let t=True ; f=False
*Main&gt; e [t,f,t] [[f,f,f],[t,t,t]] 4
[False,False,False,False,False]