MY DUDES, my code works!!

Need help with the site/forum/pets? Ask questions and get help from other members here.

MY DUDES, my code works!!

Postby crumblecake » Tue Dec 27, 2016 3:00 pm

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!!
Image
xxxxixxxixxxxcrumblecake

xxxixart shop | chubbies

borzoi crew wrote:
•••••••••••••••
"quoet"

•••••••••••••••
User avatar
crumblecake
 
Posts: 929
Joined: Sun May 20, 2012 9:52 am
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Re: MY DUDES, my code works!!

Postby Aho. » Wed Dec 28, 2016 3:42 am

*thi si too smart for me



i dont even know what mc square means

macaroni cucumbers square
I FXXY O UXXL O V EXXM E
══════════════
L E TXXM E - - - - - - - - - - -
-_-_-_-_-_-_-_-_-_-_-_-_-_-
Female||Bisexual||Proud Aho
---------------------------------
Always accepting donations
to my
Stocking Hoard.
══════════════
G O O O O O O O O O O O O



BestBuddie Senpai Buddie
Buddd Swaggggg "Child"
Franjesica Crazy Candiiiiii
O My favorite mod Cousin
Link ● Link ● Link
-_-_-_-_-_-_-_-_-_-_-_-_-_-
User avatar
Aho.
 
Posts: 4926
Joined: Sat Jun 27, 2015 7:39 pm
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Re: MY DUDES, my code works!!

Postby leggieboo » Wed Dec 28, 2016 3:50 am

This does make basically zero sense to me, but can I ask what you're making?
Image
User avatar
leggieboo
 
Posts: 495
Joined: Sun May 03, 2015 9:20 am
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Re: MY DUDES, my code works!!

Postby crumblecake » Wed Dec 28, 2016 9:02 am

leggieboo wrote:This does make basically zero sense to me, but can I ask what you're making?

I'm making a random picker c:
basically on a list of 'fork, spoon, knife' it would print a random choice. If you mean what for, I was making it for my new species Globarkies which this makes a lot more sense in Globarkie context xD
Image
xxxxixxxixxxxcrumblecake

xxxixart shop | chubbies

borzoi crew wrote:
•••••••••••••••
"quoet"

•••••••••••••••
User avatar
crumblecake
 
Posts: 929
Joined: Sun May 20, 2012 9:52 am
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Re: MY DUDES, my code works!!

Postby crumblecake » Wed Dec 28, 2016 9:02 am

=Kohai= wrote:*thi si too smart for me



i dont even know what mc square means

macaroni cucumbers square


oh boy love me some macaroni cucumber square!!
Image
xxxxixxxixxxxcrumblecake

xxxixart shop | chubbies

borzoi crew wrote:
•••••••••••••••
"quoet"

•••••••••••••••
User avatar
crumblecake
 
Posts: 929
Joined: Sun May 20, 2012 9:52 am
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Re: MY DUDES, my code works!!

Postby arbor fray stain » Wed Dec 28, 2016 11:00 am

im learning python in my precalc class rn so i mostly understand, that seems pretty cool :)
Image
Image
ImageImage
ImageImage
please click and feed! :)
User avatar
arbor fray stain
 
Posts: 1182
Joined: Thu Dec 06, 2012 1:20 pm
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Re: MY DUDES, my code works!!

Postby crumblecake » Wed Dec 28, 2016 2:46 pm

Arbor Fray Stain wrote:im learning python in my precalc class rn so i mostly understand, that seems pretty cool :)


Oh boy precalc?? I'm dreading calculus but I'm only in Geometry (8th grade). Also it would be so cool if our classes learned python...
Image
xxxxixxxixxxxcrumblecake

xxxixart shop | chubbies

borzoi crew wrote:
•••••••••••••••
"quoet"

•••••••••••••••
User avatar
crumblecake
 
Posts: 929
Joined: Sun May 20, 2012 9:52 am
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Re: MY DUDES, my code works!!

Postby Summer Electrodes » Fri Dec 30, 2016 11:19 am

ah, I can't believe some people are so smart and actually understand this..
so planet would be 10 (one of the outcomes)
then why would moon be 11?
are the choices 10-20?
ahh xD
I thought I was good at math xD nope
Summer Electrodes
 
Posts: 2071
Joined: Sun Jan 13, 2013 6:21 am
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Nice work.

Postby Icey29 » Fri Dec 30, 2016 4:08 pm

Gotta get those python shell scripts running! Do you think you're going to stick with programming? I can direct you to some helpful resources.
User avatar
Icey29
 
Posts: 116
Joined: Fri Nov 16, 2012 3:17 pm
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Re: MY DUDES, my code works!!

Postby Sei It » Mon Jan 09, 2017 2:50 am

OOH AS SOMEONE WHO KNOWS PYTHON THIS IS VERY FANCY
User avatar
Sei It
 
Posts: 8289
Joined: Sun Feb 24, 2013 12:33 am
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Who is online

Users browsing this forum: Lissyflecky and 38 guests