I heard when people use names others get pissed but I never saw it but I may be wrong but, im retarded about this shit because im a newfag but i am updating on the dorf fort ripoff. (pic is not from my version, i wish) The code is and its small enough I can just send a .cpp file you can look at it through a virus checker or whatever its safe I mean it is just a txt but idk people can sneak viruses into anything or maybe im just retarded.Im new to c++ so this code will most likely be shit but im coming here just to ask for advice on how to improve with my code and stuff in c++ in general thats all idk if there are help threads so I hope i dont get banned or whatever, basically im making a dwarf fortress but flawless but Im shit at coding so im first coding the easy stuff so if you know how to improve the code i sent, better methods and that stuff in general. help. also my captcha was DAD8H4 lmao. FILE IS IN COMMENTS BECAUSE I WONT BOTHER WITH DOING CAPTCHA AGAIN AND AGAIN UNTIL THE FILE FUCKING WORKS
#include <iostream>#include <string>#include <array>#include <random>#include <stdlib.h>#include <time.h>// Function to generate and print a random dwarf full namevoid PrintRandomDwarfFullName() { // Arrays of possible names srand(time(NULL)); int number = rand() % 140; std::array<std::string, 10> first_name_possibilities = { "Anemisht", "Mossus", "Urist", "Yuanvioch", "Constantine", "Hearn", "Easesa", "Elijah", "Tavi", "Octavian" }; std::array<std::string, 10> last_name_possibilities = { "Anemisht", "Mossus", "Urist", "Yuanvioch", "Constantine", "Hearn", "Easesa", "Elijah", "Tavi", "Octavian" }; // Random number generator setup std::random_device dev; // Obtain a random seed from the hardware std::default_random_engine gen{dev()}; // Create a random number generator with that seed // Define the size of the arrays auto first_name_size = first_name_possibilities.size(); auto last_name_size = last_name_possibilities.size(); // Create uniform distributions for the indices std::uniform_int_distribution<int> dis_first_name(0, first_name_size - 1); std::uniform_int_distribution<int> dis_last_name(0, last_name_size - 1); // Generate random indices for first and last names int first_name_index = dis_first_name(gen); // Random index for the first name int last_name_index = dis_last_name(gen); // Random index for the last name // Combine both names into a full name std::string full_info = first_name_possibilities[first_name_index] + " " + last_name_possibilities[last_name_index] + " And the age is " + std::to_string(number); std::cout << number << std::endl; // Print the full name std::cout << "Name: " << full_info << std::endl;}int main() { PrintRandomDwarfFullName(); // Call the function to print the full name return 0;}Thats odd, someone please find a way to upload .cpp or .txt to 4chan
>>102419740>im coming here just to ask for advice on how to improve with my code>>>/g/dpt/>>>/g/sqt/>>102419754 cout << "use the code tags" https://4chan.org/rules#g
cout << "use the code tags"