static void Main(string[] args) { PingPongGame Game = new PingPongGame(57, 21); Game.Run(0); Console.ReadLine(); }
/// <summary> /// The main entry point for the application. /// </summary> static void Main(string[] args) { using (PingPongGame game = new PingPongGame()) { game.Run(); } }
public HomeModule() { Get["/"] = _ => { return View["index.cshtml"]; }; Post["/"] = _ => { PingPongGame.ClearAll(); PingPongGame pingPongGame = new PingPongGame(int.Parse(Request.Form["userInput"])); List<string> userList = pingPongGame.GetAll(); return View["index.cshtml", userList]; }; }
public void Test1ReturnAListOfPingsAndPongs() { //Arrange int userInt = 7; PingPongGame pingPongGame = new PingPongGame(userInt); List<string> userList = pingPongGame.GetAll(); //Act List<string> testList = new List<string>{"1", "2", "ping", "4", "pong", "ping", "7"}; //Assert Assert.Equal(testList, userList); }
public static void Main() { Console.WriteLine("How high do you want to go [enter an integer 1 or greater]:"); string stringNumber = Console.ReadLine(); int maxNumber = int.Parse(stringNumber); if (maxNumber < 1) { Console.WriteLine("Please enter a valid number!"); Main(); } else { List <string> outputList = PingPongGame.PlayPingPong(maxNumber); foreach (string entry in outputList) { Console.WriteLine(entry); } } }