Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace Code_for_Billy
- {
- class Program
- {
- static void Main(string[] args)
- {
- /* Helping Billy code in C#. Here's my recommendations on the best way to code your program, much more elegant.
- if you need anymore help, message me on xfire or something, currently working on C# Project myself to pass the time */
- Console.WriteLine("Welcome to the derpingson derpton. What do they call you by?");
- string name = Console.ReadLine();
- Console.WriteLine("Sup " + name + ".");
- System.Threading.Thread.Sleep(1000); // You didn't notice this on the video, but you didn't include a pause here, and immediately cleared the screen, so this was never visible.
- Console.Clear();
- Console.WriteLine("Riddle me this:");
- QuestionTimeMotherFucker(name); // Sends the program to the QuestionTimeMotherFucker procedure below and passes the variable "name"
- }
- static void QuestionTimeMotherFucker(string name)
- {
- Console.WriteLine("How much wood would a woodchuck chuck, if a woodchuck could chuck wood?");
- System.Threading.Thread.Sleep(1500);
- Console.WriteLine("1. One piece of wood");
- System.Threading.Thread.Sleep(300); // Pause for nicer formatting
- Console.WriteLine("2. Two pieces of wood");
- System.Threading.Thread.Sleep(300); // Again, pause for nicer formatting
- Console.WriteLine("3. Bare wood bruv");
- string response = Console.ReadLine();
- if (response == "1" || response == "2") // If the response is 1 or 2 - || = OR
- {
- Console.WriteLine(""); // New line, just nicer formatting
- Console.WriteLine("Lmao, " + name + " you fucking retard, try again.");
- System.Threading.Thread.Sleep(1000);
- }
- else if (response == "3")
- {
- Console.WriteLine("");
- Console.WriteLine("Correct, " + name + "! The program will now exit, as there is nothing else to be done :)");
- System.Threading.Thread.Sleep(4000);
- Environment.Exit(0); // If the user enters the correct answer the program closes
- }
- else // Could also use a Try/Catch to deal with any unexpected input, but in this case, because the number of valid inputs is limited, a simple else will suffice
- {
- Console.WriteLine("");
- Console.WriteLine("Please enter an integer, either 1, 2 or 3");
- System.Threading.Thread.Sleep(1000);
- }
- /* If the user enters an incorrect answer the program then loops back to the start of QuestionTimeMotherFucker
- If the user has entered the correct answer, this part of the code never gets executed anyways */
- Console.Clear();
- System.Threading.Thread.Sleep(1000);
- QuestionTimeMotherFucker(name);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement