Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Animal generator (Under construction!)
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { //Name: This code goes through 26 letters and chooses 1 in capital letters and 9 in non-capital letters. char[] letters = "abcdefghijklmnopqrstuvwxyz".ToCharArray(); char[] cletters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToCharArray(); Random r = new Random(); string randomString = ""; string randomCString = ""; for (int i = 0; i < r.Next(2,16); i++) { randomString += letters[r.Next(0, 25)].ToString(); } for (int i = 0; i < 1; i++) { randomCString += cletters[r.Next(0, 25)].ToString(); } Console.WriteLine("Name: "+ randomCString+randomString); Random rnd = new Random(); int Gender = rnd.Next(0,2); int Food = rnd.Next(1,5); if (Gender == 1) { Console.WriteLine("Gender: Male"); } else { Console.WriteLine("Gender: Female"); } Random rHeightAndWeight = new Random(); int height = rHeightAndWeight.Next(0, 100); Console.WriteLine("Height: "+height+" cm"); int weight = rHeightAndWeight.Next(0, 1000); Console.WriteLine("Weight: "+weight+" g"); int length = rHeightAndWeight.Next(0, 100); Console.WriteLine("Length: "+length+" cm"); int width = rHeightAndWeight.Next(0, 100); Console.WriteLine("Width: "+width+" cm"); Console.WriteLine("Volume: "+ height*length*width +" cm^2"); if (Food == 1) { Console.WriteLine("Diet: Meat"); } else if (Food == 2) { Console.WriteLine("Diet: Leaves"); } else if (Food == 3) { Console.WriteLine("Diet: Vegetables"); } else if (Food == 4) { Console.WriteLine("Diet: Grass"); } } } }
run
|
edit
|
history
|
help
0
Convert String to Pig Latin
list copy test
VBA
ParseIpRanges invalid character in string
Vajdalinky
schach 1 sem
sdfghyjujyhtgrfedcf
Namespaces multiple
Creating arrays
look at this, soaches