Hello Community, so im working for a long time on a project which is breaking my brain at the moment.
So im working on an adress generator which is creating random adressinformations
the adress looks like: Firstname,Lastname,Country,City,Street,Streetnumber,ZIP and some other things
Each information is stored into a seperated txt file.
What i wanna do ?
So the User is pressing the "generate" Button and the Bot should generate a complete random adressinformation set wiht a logic behind it.
what do i mean with "logic"?
the bot takes a random first and last name.
After that he choose from 16 Countrys 1.
Depending on the choosen Country he takes a City which is inside this Country.
Depending on the choosen City he takes a Street which is inside this City
Depending on the choosen City he takes a ZIP code for this City
My idea how to solve that was:
making a random variable with the number 1-16
making a case function with the 16 Countrys
Depending on the random Country Number he takes one of the 16 Countrys
Each Country has several cases for the Citys like -> Country A has 3 Citys = 3 Cases
Depending on which case he took for the City it will read the right file with the Streetnames and ZIP Codes.
DO you think this will work or there is any easier way to handle this "random logic"?
cause its a lot of work even its repeating non stop and i need to create for every case a random variable number cause every country has different amount of citys
example:
Country A has 5 Citys
Country B has 3 Citys
Country C has 12 Citys
and so on
if i do it like i mentioned i need to create for every random number a variable to get a random number from the city to get a random city.
Can someone follow me to this point and has any advices how i can make it more easier to handle and make it less work of scripting :)
thanks for reading and understanding :)