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); }); }
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); }