What would the logic in the game loop of Lai Games "Stacker" be?
<p>I'm trying to comprehend the logic behind this game: </p>

<p><a href="http://i.stack.imgur.com/z2hWr.jpg" rel="nofollow">Lai Games - Stacker Arcade Machine</a></p>

<p>In my mind - Each loop will have a master Array.</p>

<p>eg. [1,1,1,1,1,1,1]</p>

<p>and your player array:</p>

<p>eg. [1,1,1,0,0,0,0]</p>

<p>and each tick the player will update</p>

<p>eg. [0,0,1,1,1,0,0]</p>

<p>and if the player matches the master - the stack grows.</p>

<p>eg. <strong>PLAYER [0,0,1,1,1,0,0]</strong></p>

<p>eg. <strong>MASTER [0,0,1,1,1,0,0]</strong></p>

<p>Otherwise, if there's a mismatch - the player array trims, and grows:</p>

<p>eg. <strong>PLAYER [0,1,1,1,0,0,0]</strong></p>

<p>eg. <strong>MASTER [0,0,1,1,1,0,0]</strong></p>

<p>eg. <strong>RESULT [0,0,1,1,0,0,0]</strong></p>

<p>This is the best way I can think of - Is there are a better method? </p>