Exemplo n.º 1
0
        public void Tick()
        {
            var oldCoordinate = Ant.Coordinate;

            Colors color = Ant.Move(this);

            _matrix[oldCoordinate.X, oldCoordinate.Y] = color;
        }
Exemplo n.º 2
0
#pragma warning disable IDE1006 // Naming Styles

        // Timer tick function
        private void tmrMoveTimer_Tick(object sender, EventArgs e)
        {
            // If ant movement fails, stop the animation
            if (langton.Move() == false)
            {
                mnuMainMenuFileStop.PerformClick();
                langton.ResetAntPos();
                return;
            }

            // Otherwise, update counter
            MoveCount++;
            txtStep.Text = MoveCount.ToString();
        }