public static string PrintResults(SimpleGame game, string power, string beat, int[] deck) { string txtResults = "Power: " + power + ", Bet: " + beat + ". Deck: [" + deck[0] + "," + deck[1] + "," + deck[2] + "]." + "\r\n"; for (int i = 0; i < game.Results.Length; i++) { txtResults += "* Game" + (i + 1) + ": " + game.Cards[i] + ". Result: " + game.Results[i] + ".\r\n"; } txtResults = txtResults.Remove(txtResults.Length - 2, 2); return(txtResults); }
public static string Play() { Console.WriteLine("Choose power: 1-Weak 2-Normal 3-Strong"); int power = int.Parse(Console.ReadLine()); Console.WriteLine("Choose beat: 1-Easy 2-Typical 3-Hard"); int beat = int.Parse(Console.ReadLine()); int[] deck = { power * 3 + beats[beat - 1, 0], beats[beat - 1, 1], beats[beat - 1, 2] }; deck[2] += deck[1] / 3; string[] marksDecks = CreateDecks(deck); SimpleGame game = new SimpleGame(marksDecks, 4); return(PrintResults(game, powerName[power - 1], beatName[beat - 1], deck)); }
private static void PlaySimpleGame(string inputFileName, string outputFileName) { SimpleGame game = new SimpleGame(10); File.WriteAllText(outputPathFolder + outputFileName, game.PrintResults()); }