コード例 #1
0
        public IActionResult CheckPattern(ColoursDto colours)
        {
            var boardResult = Board.CheckPattern(colours.Colours);

            if (!boardResult.result)
            {
                return(BadRequest("Board is not properly initialized"));
            }

            return(Ok(
                       new
            {
                ColoursCorrectlyGuessed = boardResult.colour,
                ColoursAndPositionCorrectlyGuessed = boardResult.positionAndColour
            }
                       ));
        }
コード例 #2
0
 public IActionResult Initialize(ColoursDto request = null)
 {
     Board.Initialize(request.Colours);
     return(Ok());
 }