| View previous topic :: View next topic   | 
	
	
	
		| Author | 
		Message | 
	
	
		Trucido Moderator
  Reputation: 6
  Joined: 08 Sep 2007 Posts: 2792
 
  | 
		
			
				 Posted: Mon Jul 07, 2008 12:19 am    Post subject: [C#]First Console App | 
				       | 
			 
			
				
  | 
			 
			
				Basic Console App.
 
You enter a name, press enter and it tells you how long their penis is.
 
=P
 
(It generates a random number 0-100)
 
Thanks to Holland and Jonyleeson for helping me work out the kinks.
 
(And improve my code)
 
 
Heres the source, Just in case any other beginners are curious.
 
 	  | Code: | 	 		  //Trucido's C# Penis Length Generator!
 
//Thanks to Holland - For fixing the loop function
 
//Katana - For trying =]
 
//Jonyleeson - For being awsome, fixing name error, and improving code.
 
using System;
 
 
namespace ConsoleAppTemplate
 
{
 
    public class Program
 
    {
 
        static void Main(string[] args)
 
        {
 
            System.Random RandNum = new System.Random();
 
            {
 
                Console.ForegroundColor = ConsoleColor.Blue;
 
                {
 
                    Console.Write("Enter your name, to see the exact measurments of your penis. Name:");
 
                    {
 
                        int n = 4;
 
                        do
 
                        {
 
                            string sName = Console.ReadLine();
 
                            if (sName == "Trucido")
 
                            {
 
                                Console.WriteLine("Trucido's penis cannot be measured by this simple console app");
 
                            }
 
                            else
 
                            {
 
                                Console.WriteLine("Lulz," + sName + " your penis is " + RandNum.Next(100) + " cm Long ");
 
                            }
 
                            Console.WriteLine("Enter another Name and Press Enter");
 
                        } while (n < 10);
 
                    }
 
                }
 
            }
 
        }
 
    }
 
} | 	  
	
  
	 
	
	 
 _________________
 I'm out.  | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		hcavolsdsadgadsg I'm a spammer
  Reputation: 26
  Joined: 11 Jun 2007 Posts: 5801
 
  | 
		
			
				 Posted: Mon Jul 07, 2008 2:40 am    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				| what is with the nine hundred brackets?
 | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		atom0s Moderator
  Reputation: 205
  Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
  | 
		
			
				 Posted: Mon Jul 07, 2008 2:49 am    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				Every single program you make in your life time should not end up in this section.
 _________________
 - Retired.  | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		AndrewMan Grandmaster Cheater Supreme
  Reputation: 0
  Joined: 01 Aug 2007 Posts: 1257
 
  | 
		
			
				 Posted: Mon Jul 07, 2008 4:18 pm    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				 	  | Wiccaan wrote: | 	 		  | Every single program you make in your life time should not end up in this section. | 	  
 
 
This is true. 
 
 
I would just release stuff you are proud of. Not something you tried out and it worked.
 
 
But nice job, this app is funny   
 _________________
  | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		NINTENDO Grandmaster Cheater Supreme
  Reputation: 0
  Joined: 02 Nov 2007 Posts: 1371
 
  | 
		
			
				 Posted: Fri Jan 23, 2009 10:24 am    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				Why are you writeing System.Random when your using the System namespace? 
 
 
 	  | Code: | 	 		  using System;
 
namespace ConsoleApplication1
 
{
 
    class Program
 
    {
 
        static void Main(string[] args)
 
        {
 
 
            Random rand = new Random();
 
            Console.ForegroundColor = ConsoleColor.Blue;
 
            
 
            while (true)
 
            {
 
                Console.Write("Enter your name, to see the exact measurments of your penis. Name:");
 
                String sname = Console.ReadLine();
 
                if (sname.Length<=0 || sname =="exit")
 
                {
 
                    break;
 
                }
 
                else if(sname=="Trucido")
 
                {
 
                    Console.WriteLine("Trucido's penis cannot be measured by this simple console app");
 
                }
 
                else
 
                {
 
                    Console.WriteLine("Lulz, " + sname + ", your penis is " + rnd(100) + " cm long");
 
                }
 
                
 
              
 
            }
 
        }
 
        static int rnd(int i)
 
        {
 
            return new Random().Next(i);
 
        }
 
        
 
    }
 
}
 
 | 	  
 _________________
 Intel over amd yes.  | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		nwongfeiying Grandmaster Cheater
  Reputation: 2
  Joined: 25 Jun 2007 Posts: 695
 
  | 
		
			
				 Posted: Fri Jan 23, 2009 11:44 pm    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				| You has been trolled by slovach and Wiccan.
 | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		hacksign23 Master Cheater
  Reputation: 0
  Joined: 26 Nov 2006 Posts: 404
 
  | 
		
			
				 Posted: Thu Jan 29, 2009 3:28 pm    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				C#.NET** 
 
 
btw, is there something similar to system's functions for regular C++?
 _________________
  | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		hcavolsdsadgadsg I'm a spammer
  Reputation: 26
  Joined: 11 Jun 2007 Posts: 5801
 
  | 
		
			
				 Posted: Thu Jan 29, 2009 4:45 pm    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				 	  | hacksign23 wrote: | 	 		  C#.NET** 
 
 
btw, is there something similar to system's functions for regular C++? | 	  
 
 
1. It is just C#, don't append a .NET to it, it's wrong.
 
 
2. Obviously
 
 
3. Why does this keep getting bumped.
 | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		S3NSA :3
  Reputation: 1
  Joined: 06 Dec 2006 Posts: 1908 Location: England.
  | 
		
			
				 Posted: Fri Jan 30, 2009 10:51 am    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				 	  | nwongfeiying wrote: | 	 		  | You has been trolled by slovach and Wiccan. | 	  
 
Suggest you learn the definition of "trolling".
 _________________
 ~ You can find me on irc.ccplz.net x  | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		nwongfeiying Grandmaster Cheater
  Reputation: 2
  Joined: 25 Jun 2007 Posts: 695
 
  | 
		
			
				 Posted: Sun Feb 01, 2009 12:48 am    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				 	  | S3NSA wrote: | 	 		   	  | nwongfeiying wrote: | 	 		  | You has been trolled by slovach and Wiccan. | 	  
 
Suggest you learn the definition of "trolling". | 	  
 
 
It means to cause anger to the poster; you need to lurk moar.
 | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		LolSalad Grandmaster Cheater
  Reputation: 1
  Joined: 26 Aug 2007 Posts: 988 Location: Australia
  | 
		
			
				 Posted: Sun Feb 01, 2009 12:56 am    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				 	  | nwongfeiying wrote: | 	 		   	  | S3NSA wrote: | 	 		   	  | nwongfeiying wrote: | 	 		  | You has been trolled by slovach and Wiccan. | 	  
 
Suggest you learn the definition of "trolling". | 	  
 
 
It means to cause anger to the poster; you need to lurk moar. | 	  
 
 
http://en.wikipedia.org/wiki/Troll_(Internet)
 
 
No, it means to provoke them into giving an amusing response; you need to lurk moar.
 
 
Also, this topic should probably be locked.  
 _________________
  | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		hcavolsdsadgadsg I'm a spammer
  Reputation: 26
  Joined: 11 Jun 2007 Posts: 5801
 
  | 
		
			
				 Posted: Sun Feb 01, 2009 2:00 am    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				 	  | LolSalad wrote: | 	 		  Also, this topic should probably be locked.   | 	  
 
 
Great idea.
 | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		 |