Example #1
0
        private bool Update(Direction dir)
        {
            ulong score;
            bool  isUpdated = Game.Update(this.Board, dir, out score);

            this.Score += score;
            return(isUpdated);
        }
Example #2
0
        private bool IsDead()
        {
            ulong score;

            foreach (Direction dir in new Direction[] { Direction.Down, Direction.Up, Direction.Left, Direction.Right })
            {
                ulong[,] clone = (ulong[, ])Board.Clone();
                if (Game.Update(clone, dir, out score))
                {
                    return(false);
                }
            }

            // tried all directions. none worked.
            return(true);
        }