Last active
March 31, 2017 06:37
-
-
Save dvtate/a4b56f15e3f21467ad543c3ebe64aaa7 to your computer and use it in GitHub Desktop.
a helloworld application was all it took to tell me that C# wasn't for me...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class Dav { | |
string name; | |
bool noname = false;//default = no-loop | |
static void Main(){//run once @ start-up | |
Console.WriteLine ("Hi, What's your name?");//output to console | |
name = Console.ReadLine ();//get response from console | |
if (name == "") { // if zero-length string | |
noname = true; | |
Console.WriteLine("Can't you type?"); | |
} else { | |
Console.Write ("Hey, "); | |
Console.Write (name); | |
Console.Write (", I hope you have a nice day."); | |
} | |
while (noname == true) {//prompt the user for input until they type/*replace with for loop and Bang loop*/ | |
Console.WriteLine("GIVE ME INPUT!"); | |
name = Console.ReadLine(); | |
if (name == "") { | |
noname = true; | |
} else { | |
noname = false; | |
Console.Write ("hey, "); | |
Console.Write (name); | |
Console.Write (", I hope you die in a hole."); // an attitude | |
} | |
} | |
Console.Read(); // prevents console from auto exit (winshit problem) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is dumb as hell...