WOW as if it was something as easy as that,i had been looking for awhile on
what i was doing wrong. as it seems i just don't know my way around if
statements at all, thank a bunch for this. makes everything else i have been
code work
thanks again
--
http://mail.python.org/mailman/listinfo/pyt
import random
def player():
hp = 10
speed = 5
attack = random.randint(0,5)
def monster ():
hp = 10
speed = 4
def battle(player):
print ("a wild mosnter appered!")
print ("would you like to battle?")
answer = input()
if answer == ("yes"):
return player(
the idea was to store variables for later use, but you are correct i don't
understand functions or if that is even the best way to do it. i guess i'd want
to be able to call the HP and ATTACK variables of player for when the battle
gets called. i would then use the variables in battle to figure
darn i was hoping i could put off learning classes for a bit, but it seems that
is not the case. i have tested it a bit and it seems to be working correctly
now.
import random
class player():
hp = 10
speed = 5
attack = random.randint(0,5)
print (player.
import random
class player():
hp = 10
attack = random.randint(0,5)
class monster():
hp = 10
attack = random.randint(0,4)
def battle():
print ("a wild mosnter appered!")
print ("would you like to battle?")
answer = input()
if answer == ("yes"):
while monst
the Classes and __init__ still don't make much sense actually. i have tried and
tried again to make it generate numbers between 0 and 5 in a while statement
but it just doesn't seem to be working.
import random
class Player():
hp = 10
def __init__(self, patt):
self.att = rando