1/21/2024 0 Comments Random first name generatorNow below the declaration of the two string arrays let's create a static function called GenerateName which will not receive any parameter and will return a string which will be the random name generated from the names and last names lists. private static readonly string firstNames = Now let's create another class called NamesGenerator.cs here we will start declaring two string arrays called firstNames and lastNames respectively to store our hard-coded list of names and last names. Let's begin by creating a new console application using the dotnet cli new command.ĭotnet new console -o RandomNamesGenerator In this case, a random names generator comes greatly in handy to take this responsibility (and also struggle) from the player so he can start enjoying the actual game than worrying about thinking of a clever name which can take from some second to several minutes even some hours (gamers know this nightmare □) Create a new console app Reasons can be many, for example, imagine an RPG video game if you have ever played you are familiar with the struggle of giving a name to your new character either because you lack the imagination or because the perfect name that you came up with was already taken. Why would I need to generate a name randomly Ok, that is enough of me now let's get into the main topic a "Random name generator". Hello guys, I'm happy to be writing again as it's one of my goals this year to try and have an online presence and acquire new hobbies like blogging which I found attractive since I was young but constancy has never been one of my strengths but I'm giving my best to change that from now on.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |