protected bool Equals(Field other) { if (Content.Length != other.Content.Length) { return false; } return Content .Zip(other.Content, (mine, theirs) => new {mine, theirs}) .All(pair => pair.mine.SequenceEqual(pair.theirs)); }
private static void AddFieldToPrintOutput(Field field, FieldPrintOutputBuilder builder) { for (var i = 0; i < field.Rows; i++) { for (var j = 0; j < field.Columns; j++) { if (field.Content[i][j] == '*') { builder.AddCharacter('*'); } else { var number = field.CountNumberOfAdjacentBombs(j, i); builder.AddCharacter(number.ToString(CultureInfo.InvariantCulture)[0]); } } builder.AddLineTerminator(); } }