Example #1
0
 public void Draw()
 {
     SnakeBody.ForEach(n =>
     {
         string text = "*";
         if (n == SnakeBody.Head)
         {
             text = "@";
         }
         Helper.Helper.Write(n.Value, text);
     });
 }
 public void Draw()
 {
     SnakeBody.ForEach(n =>
     {
         var text = "*";
         if (n == SnakeBody.Head)
         {
             text = "@";
         }
         ConsoleHelper.Write(n.Value, text);
     });
 }
Example #3
0
        public bool IsCanibal()
        {
            HashSet <Position> set = new HashSet <Position>();
            bool isCanibal         = false;

            SnakeBody.ForEach(n =>
            {
                if (set.Contains(n.Value))
                {
                    isCanibal = true;
                }
                set.Add(n.Value);
            });

            return(isCanibal);
        }