Jump to content

Announcements

  • Topics

  • Posts

    • too lazy to write the full thing out. give him an example with it like this tucker static void Main(string[] args)
          {
              int intUserInput = 0;
              bool validUserInput = false;
              
              while (validUserInput == false)
              {
                  try
                  { Console.Writeline("Please choose a race. 1 = Human. 2 = Dwarf. 3 = Elf.");
                    intUserInput = int.Parse(Console.Readline()); //attempt to parse input as int variable
                  }
                  catch (Exception) { } //catch invalid input exception
                  
                  if ( (intUserInput >= 1) && (intUserInput <= 3) ) //ensure entered int is >= 1
                    { validUserInput = true; }
                  else { Console.Writeline("Invalid Input.  "); }
              }
              
              Console.Writeline("You Entered " +intUserInput);
          }
    • (wrote at 6 am in the morning with 0 sleep, dont judge my spelling or if I did something dumb as fuck in the code)
    • probs a better way of doing this but I made this in like a minute   using System; namespace ConsoleApp3
      {
          class Program
          {
              static void Main(string[] args)
              {
                  Console.WriteLine("Matrix fucken 1 if you wanna be a pig 2 if you wanna be a mp, same thing but you get the point");
                  string matrixbetterpayme = Console.ReadLine();             if (matrixbetterpayme.Contains("1"))
                  {
                      Console.WriteLine("goodboi");
                  }
                  else if (matrixbetterpayme.Contains("2"))
                  {
                      Console.WriteLine("naughtyboi");
                  }
              }
          }
      }
          this should give you an idea of what you need to do. also I have never really wrote a console application before but if you are allowed to do windows forms you can do it like this   using System;
      using System.Collections.Generic;
      using System.ComponentModel;
      using System.Data;
      using System.Drawing;
      using System.Linq;
      using System.Text;
      using System.Threading.Tasks;
      using System.Windows.Forms; namespace WindowsFormsApp3
      {
          public partial class Form1 : Form
          {
              public Form1()
              {
                  InitializeComponent();
              }         private void Form1_Load(object sender, EventArgs e)
              {
                  
              }         private void button1_Click(object sender, EventArgs e)
              {
                  if (textBox1.Text == ("gay"))
                  {
                      if (textBox2.Text == ("dad"))
                      {
                          if (textBox3.Text == ("fary"))
                          {
                              MessageBox.Show("Your a gay dad fary!");
                          }
                      }
                  }
                  else if (textBox1.Text == ("straight"))
                  {
                      if (textBox2.Text == ("dad"))
                      {
                          if (textBox3.Text == ("fury"))
                          {
                              MessageBox.Show("Your a straight dad fury!");
                          }
                      }
                  }
              }
          }
      }
          I just noticed instead of doing separate ifs you could make it alot more clean and do it like this   else if (textBox1.Text == ("straight") && textBox2.Text == ("dad") && textBox3.Text == ("fury")) { //Your mum gay }     and incase you need to explain it to your brain dead class   using System;
      using System.Collections.Generic;
      using System.ComponentModel;
      using System.Data;
      using System.Drawing;
      using System.Linq;
      using System.Text;
      using System.Threading.Tasks;
      using System.Windows.Forms; //Includes to make it work namespace WindowsFormsApp3
      {
          public partial class Form1 : Form
          {
              public Form1()
              {
                  InitializeComponent();
              }         private void Form1_Load(object sender, EventArgs e)
              {
                  
              }         private void button1_Click(object sender, EventArgs e) //This means someone has clicked button1
              {
                  if (textBox1.Text == ("gay")) //This is seeing what the user has inputted to textbox1 and checking if that is = to gay
                  {
                      if (textBox2.Text == ("dad"))
                      {
                          if (textBox3.Text == ("fary"))
                          {
                              MessageBox.Show("Your a gay dad fary!");
                          }
                      }
                  }
                  else if (textBox1.Text == ("straight")) //This is seeing what the user has inputted to textbox1 and checking if that is = to straight
                  {
                      if (textBox2.Text == ("dad"))
                      {
                          if (textBox3.Text == ("fury"))
                          {
                              MessageBox.Show("Your a straight dad fury!");
                          }
                      }
                  }
              }
          }
      }   or if your using the shitty console app I made   using System; namespace ConsoleApp3
      {
          class Program
          {
              static void Main(string[] args)
              {
                  Console.WriteLine("Matrix fucken 1 if you wanna be a pig 2 if you wanna be a mp, same thing but you get the point"); //Writing a line in the console telling the user what to do
                  string matrixbetterpayme = Console.ReadLine(); //Gathering the information that the user inputted             if (matrixbetterpayme.Contains("1")) //Checking if the user inputted 1
                  {
                      Console.WriteLine("goodboi");
                  }
                  else if (matrixbetterpayme.Contains("2")) //Checking if the user inputted 2
                  {
                      Console.WriteLine("naughtyboi");
                  }
              }
          }
      }   also if you use the console app you will need to set a break point in visual studio after (Console.WriteLine("naughtyboi");  so it dose not crash if you dont know how to do it, just do this https://gyazo.com/b591ecd5d6591b0139ab67e6cf37f1fb :^) I hope I helped 
    • I can help you give me quarter of an hour
    • I can probably help you give me quarter of an hour
  • Member Statistics

    • Total Members
      266
    • Most Online
      99

    Newest Member
    😂😂😂😂😂
    Joined
  • Forum Statistics

    • Total Topics
      447
    • Total Posts
      4,084
  • Group Legend

×