private static void Program20() { Game.ShowSceneAndAddTurtle(); Turtle.OnKeyDown(KeyboardKey.Left, p => p.MoveLeft(10)); Turtle.Say("Sleeping"); Turtle.Sleep(5000); var name = Turtle.Ask("What's your name?"); Turtle.Say($"Hi, {name}"); }
private static void Program14() { Game.ShowSceneAndAddTurtle(); int age; string input = Turtle.Ask("How old are you?"); while (!int.TryParse(input, out age)) { input = Turtle.Ask("Are you kidding? That's not a number. How old are you?"); } Turtle.Say($"{age}? You're looking good for your age!"); }