while($alive) { $turn++; printf "Turn \#% 4d\t", $turn; push @histx, $x; push @histy, $y; push @histh, $heading; $pc = 0 if $pc < 0; $pc = CODESIZE - 1 if $pc >= CODESIZE; my $ci = $code[$pc]; # Current Instruction print $opcode[$ci], "\t"; $pc++; # Just like CPUs do $microcode[$ci]->(@some_params); $pc++; $alive = 0 if $turn > 1000; }