Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static int Menu(string[] options) {
- for(int i = 0; i < options.length; i++) {
- Console.WriteLine("[{0}] {1}", i+1, options[i]);
- }
- Console.Write("Pick your fate: ");
- int choice = getInt("ENTER A NUMBER, WHOREEEEE. :)");
- while(choice < 0 || choice >= options.length) {
- Console.WriteLine("You fail at directions. Enter a NUMBER, whore.");
- Console.Write("Pick your fate: ");
- input = Console.ReadLine();
- }
- }
- static int getInt(string failMsg="Enter a number.") {
- string input = Console.ReadLine();
- int choice;
- while(!int.TryParse(input, out choice)) {
- Console.WriteLine(failMsg);
- input = Console.ReadLine();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement