29 lines
600 B
C#
29 lines
600 B
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
|
|||
|
namespace Week_11___TTTLib
|
|||
|
{
|
|||
|
public class GameWinnerService : IGameWinnerService
|
|||
|
{
|
|||
|
public char Validate(char[,] board)
|
|||
|
{
|
|||
|
var rowOne = board[0,0];
|
|||
|
var rowTwo = board[0,1];
|
|||
|
var rowThree = board[0,2];
|
|||
|
if (rowOne == rowTwo && rowTwo == rowThree)
|
|||
|
return rowOne;
|
|||
|
|
|||
|
return ' ';
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public interface IGameWinnerService
|
|||
|
{
|
|||
|
char Validate(char[,] board);
|
|||
|
|
|||
|
}
|
|||
|
}
|