/// <summary> /// Occurs when a player that is playing in the bot makes a guess. /// Inform the bot of what was the player's guess, and the guess results (exact and near matches). /// </summary> /// <param name="round">Number of current round of the game.</param> /// <param name="result">a <c>GuessResult</c> object representing the result of a players guess.</param> private void SendGuessToBot(int round, GuessResult result) { AxiomBot bot = new AxiomBot(); var rowIndex = round - 2; bot.SetResult(rowIndex, result); }
/// <summary> /// If the user is in a game with the Bot, gives the user a hint of what would be the next best guess. /// If user continues asking for hints, the Bot should solve the problem sometime. /// </summary> /// <param name="name">Nickname of the caller user</param> /// <param name="room">Current room of the caller user</param> private void GiveHint(string name, string room) { if (!_rooms[room].Users.Contains(BotName)) { SendError("You can only request a Hint if you are playing alone with the AxiomBot."); return; } AxiomBot bot = new AxiomBot(); var hint = bot.CalculateGeneration(2000, 20); string sHint = ""; foreach (var i in hint) { sHint += i.ToString(); } Clients.Group(room).addMessage(0, "AxiomBot", $"Try guessing this combination: {sHint}"); Clients.Group(room).hint(sHint); }