Log in

View Full Version : [CODE] PyChoice [Python]



A.Justice
09-08-2012, 09:00 PM
Hey guys this is a simple python code I started, I'm probably not the first person, but if you have any question just ask and I'll answer(if I can :))


print 4+9*4
print "Thats the secret number"


def Hi ():
print "You've just entred a Phoenix Wright Case"
print "You would like PW or Edgey?"
answer = raw_input("Type Pw or Edgey and hit enter'.")
if answer == "PW" or answer== "pw" or answer== "Pw":
print "Correct Answer!"
elif answer == "Edgey" or answer=="edgey" or answer=="EDGEY":
print "Wrong answer Try again."
Hi()
else:
print "You didn't pick,Try again."
Hi()

Hi()

*Hope this is in the right section.*

Pegle
10-08-2012, 08:54 AM
I would recommend upgrading from 2.7 (or whatever you have) to 3.2.3 as it's much easier to code Python in the newer models.

EDIT: Apart from having to add brackets everywhere :rolleyes: it's a nice script

A.Justice
10-08-2012, 02:35 PM
I would recommend upgrading from 2.7 (or whatever you have) to 3.2.3 as it's much easier to code Python in the newer models.

EDIT: Apart from having to add brackets everywhere :rolleyes: it's a nice script
Thanks and I plan to to upgrade soon.

Pegle
10-08-2012, 05:58 PM
Ponies.

Um by the way that script wouldn't work as in your input you are using a ' to start but a " to end.

A.Justice
10-08-2012, 06:28 PM
Ponies.

Um by the way that script wouldn't work as in your input you are using a ' to start but a " to end.

I see what your saying, but that's for signature and I'll fix it now, I didn't even notice that. Ponies :)

Recursion
10-08-2012, 07:32 PM
print 4+9*4
print "Thats the secret number"


def Hi():
print "You've just entred a Phoenix Wright Case"
print "You would like PW or Edgey?"
answer = raw_input("Type Pw or Edgey and hit enter: ")
answer.lower()
if answer == "pw":
print "Correct Answer!"
elif answer == "edgey":
print "Wrong answer Try again."
Hi()
else:
print "You didn't pick,Try again."
Hi()
Hi()


Also, functions should return something in Python, it's good practice. :P

A.Justice
10-08-2012, 07:59 PM
print 4+9*4
print "Thats the secret number"


def Hi():
print "You've just entred a Phoenix Wright Case"
print "You would like PW or Edgey?"
answer = raw_input("Type Pw or Edgey and hit enter: ")
answer.lower()
if answer == "pw":
print "Correct Answer!"
elif answer == "edgey":
print "Wrong answer Try again."
Hi()
else:
print "You didn't pick,Try again."
Hi()
Hi()


Also, functions should return something in Python, it's good practice. :P

It is, but this was just a sample code from a bigger project I'm working on. I'll make it return something, soon.

Thanks for the feedback guys.

Pegle
10-08-2012, 10:17 PM
Any clues as to what this project is A.Justice;?

A.Justice
11-08-2012, 02:28 AM
Any clues as to what this project is A.Justice;?

Yes, for now it's going to be a word RPG(ikr there's a first time for everything), which I'll then make into a Phoenix Wright Case, using PyWright. Then an RPG game so yea it has it stages. Alot @Pegle

A.Justice
11-08-2012, 02:28 AM
Any clues as to what this project is A.Justice;?

Yes, for now it's going to be a word RPG(ikr there's a first time for everything), which I'll then make into a Phoenix Wright Case, using PyWright. Then an RPG game so yea it has it stages. Alot @Pegle

Pegle
11-08-2012, 08:09 AM
I too am/was making a text based RPG game until I went on holiday and haven't bothered got it open to start doing it again.

A.Justice
11-08-2012, 01:21 PM
I too am/was making a text based RPG game until I went on holiday and haven't bothered got it open to start doing it again.
xD, Maybe you should start it up again.

Pegle
11-08-2012, 08:03 PM
What is a Pheonix Wright Case A.Justice;?

A.Justice
11-08-2012, 08:15 PM
You know its based after the Game Phoenix Wright - Ace Attorney @Pegle (http://www.habboxforum.com/member.php?u=79257)

Pegle
11-08-2012, 08:31 PM
Ah, I'm guessing an American thing. Never heard of it before ;)

EDIT: Oh, a Japanese game. Still hadn't heard of it before.

A.Justice
11-08-2012, 09:03 PM
Ah, I'm guessing an American thing. Never heard of it before ;)

EDIT: Oh, a Japanese game. Still hadn't heard of it before.
xD, yea, but thats the plan, I'm working on the PyWright thing wright now with a friend, I'll let you know when I'm done, maybe you can test play it :).

Want to hide these adverts? Register an account for free!