Okay so probably no one understands me but I wanted to boast xD I created a stupid code for choosing random outcomes of each planet's registered findable items for my species (i.e. on Earth you can find coal, wood, and grass), printed a random choice from that list, and repeated it 10 times!! I've never used loops because I never understood them but I think now I do!
(This is not made to be an ad thread it's just hard to explain withough explaining what I've made it for!)
So let me explain:
So the species I made it for has 8 planets you can make trips to. Each planet has findable mutations and items. I put each item that can be found into a list corresponding the planet it could be found in. Earth or the moon isn't one of them, but I'll use it as an example:
On earth you can find grass, wood and coal.
That translates into: earth = ['grass', 'wood', 'coal']
On the moon you can find rocks, dust, and a flag.
That translates into: moon = ['rocks', 'dust', 'flag']
Then, I made it so the console asks a question- which planet you want to go to.
That translates into this: planet = raw_input("Which planet would you like to visit?")
Then, I made it so where if you entered earth, it would print a random choice from the list 10 times. If you entered moon, it printed a random choice from the moon list 10 times. After 10 times, it stops printing.
That translates into this:
Import random
x = 10
If planet = 'earth':
if x < 11:
Print (random.choice(earth))
X = x - 1
If x = 0:
Break
If planet = 'moon':
if x < 11:
Print (random.choice(moon))
X = x - 1
If x = 0:
Break
It now prints a random choice from the list 10 times!! It probably made about zero sense to you guys I'm sorry
So I did that for 8 planets agh it works kinda good!! Only I can run it though, or it would cause mass problems it needs a specific input of one of the actual planets in all lowercase (I could fix that part but I'm lazy) or it errors
There's probably a much more simple way to do it but you know I was lazy lol
Also the code I used was python.
Sorry I just wanted to share, I wasn't sure what boards I should have posted this in so I posted it here! Jeez sorry for the stupid post but I'm sort of proud of what I did yeah boy!!