Permalink
Browse files

[Green] Now input 'C' is supported.

  • Loading branch information...
ClausPolanka committed Apr 18, 2015
1 parent 2ad7eed commit 737d88cdae0ee4290f5fe91d624b195b8ede0166
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/domain/Diamond_Builder.cs
@@ -110,8 +110,12 @@ private IEnumerable<string> Create_Middle_Spaces_For(List<string> letters)
{
var spaces = new List<string> { "" };
- for (var i = 1; i < letters.Count; i += 2)
- spaces.Add(new String(WHITE_SPACE, i));
+ var odd_factor = 1;
+ letters.ForEach(l =>
+ {
+ spaces.Add(new String(WHITE_SPACE, odd_factor));
+ odd_factor += 2;
+ });
return spaces;
}
@@ -121,6 +125,7 @@ private IEnumerable<string> Duplicate_First_Half_of_Diamond(List<string> half_di
var duplicate = half_diamond
.Take(count: half_diamond.Count - 1)
.ToList();
+ duplicate.Reverse();
half_diamond.AddRange(duplicate);
return half_diamond;
}

0 comments on commit 737d88c

Please sign in to comment.