public static ReversiBoard GetInitial() { var result = new ReversiBoard(); result.SetRow(3, 0b00_00_00_11_10_00_00_00u); result.SetRow(4, 0b00_00_00_10_11_00_00_00u); return(result); }
public static ReversiBoard FromStrings(IEnumerable <string> source) { var result = new ReversiBoard(); foreach (var(row, index) in source.Select(x => x.Aggregate(0u, (a, c) => a << 2 | (uint)FromChar(c))).Select((x, i) => (x, i))) { result.SetRow(index, row); } return(result); }
public static Char ToChar(this Reversi source) => ReversiBoard.ToChar(source);