One dimensional cellular automata implementation?
<p>In one interview they asked me for implementation of one dimensional cellular automata  program? But I am not able to performed that? Can someone tell me how to do that? 
How to implement below program:</p>

<p>A one-dimensional cellular automata is an array where each position is either off (.) or on (X). At each time step the contents of each cell are updated using a simple rule such as the following:</p>

<ul>
<li>If a cell is off then next time it will be in the same state that the cell to its right is currently at.</li>
<li>If a cell is on then next time it will be off if both of its neighbors are currently on, otherwise it will stay on.</li>
</ul>

<p>For example, if you start with</p>

<p>....X</p>

<p>then next time you will have</p>

<p>...XX</p>

<p>and the next two steps will be</p>

<p>..XXX.XX.X</p>

<p>Write a problem that implements and displays this one dimensional cellular automata rule. You can assume that the first and last positions never change their state.</p>
