mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-22 23:26:40 -08:00
Refactoring.
This commit is contained in:
@@ -251,8 +251,12 @@ public class Pattern
|
||||
{
|
||||
Height = patternLines.Count;
|
||||
Width = patternLines.Max(x => x.Length);
|
||||
|
||||
Content = patternLines
|
||||
Content = NormalizeWidth(patternLines);
|
||||
}
|
||||
|
||||
private string[] NormalizeWidth(IReadOnlyCollection<string> patternLines)
|
||||
{
|
||||
return patternLines
|
||||
.Select(x => x.PadRight(Width, ' '))
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user