Skip to content

Commit

Permalink
Update NaughtsAndCrosses.cs
Browse files Browse the repository at this point in the history
Added author credit.
  • Loading branch information
Nicholamsious authored Jan 20, 2022
1 parent 384fcbf commit 58ab55e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions NaughtsAndCrosses.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,15 @@ private static void Main(string[] args)
}
} while (playAgain);
}
private static void SetSize()
private static void ClearConsole()
{
Console.Clear();
Console.WriteLine("Naughts and Crosses v" + Version
+ "\nChoose board size (default 3, min. 3, max 9):");
Console.WriteLine("Naughts and Crosses v" + Version + " by Nick. Website: https://nsgwick.com/coding/projects/#naughts-crosses");
}
private static void SetSize()
{
ClearConsole();
Console.WriteLine("Choose board size (default 3, min. 3, max 9):");
_size = !int.TryParse(Console.ReadLine(), out _size) ? 3 : _size > 9 ? 9 : _size < 3 ? 3 : _size;
}
private static bool ProcessChoice(int player, string choice, out int stop)
Expand Down Expand Up @@ -95,7 +99,7 @@ private static bool ProcessChoice(int player, string choice, out int stop)
}
private static void WriteBoard()
{
Console.Clear();
ClearConsole();
Console.WriteLine("Type s to skip, r to restart or q to quit.\n");
var spacer = new string('-', _size * 4 + 2);
for(var i = 1; i <= _size; i++) Console.Write("---" + i);
Expand Down

0 comments on commit 58ab55e

Please sign in to comment.