<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2668" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>hello everyone, and thanks for your help and
guidance so far.</FONT></DIV>
<DIV><FONT face=Arial size=2>amazingly enough, something i thought would be
simple has turned out to be not simple.</FONT></DIV>
<DIV><FONT face=Arial size=2>i have a sword that i want to wield. as i have it
here, i think i am wielding whatever string i type</FONT></DIV>
<DIV><FONT face=Arial size=2>as argument to wield. so i guess i need to pass
wield an object somehow instead of a string.</FONT></DIV>
<DIV><FONT face=Arial size=2>can anyone point in the right direction?
</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>class Player:<BR> def
__init__(self,name):<BR> self.name =
name<BR> self.location =
None<BR> self.inventory =
[]<BR> self.wielded =
None<BR> self.headwear =
None<BR> </FONT><FONT face=Arial size=2> def
wield(self,what):<BR> print
type(what)<BR> print 'you
wield',what<BR> self.wielded =
what<BR> <BR> <BR>
def do(self):<BR> cmd =
string.split(raw_input('>'))<BR>
verb = cmd[0]<BR> if len(cmd) >
1:<BR> target
= cmd[1]<BR>
<BR> if verb ==
'l':<BR>
self.look()<BR> elif verb in
['n','s','e','w']:
<BR>
self.move(verb)<BR> elif verb ==
'quit':<BR>
sys.exit()<BR> elif verb ==
'i':<BR> print
'wielded',self.wielded<BR>
print 'on head',
self.headwear<BR>
for a in
self.inventory:<BR>
print a.name<BR> elif verb
==
'wield':<BR>
self.wield(target)<BR> else:<BR>
print 'what?'</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>class Thing:<BR> def
__init__(self,name):<BR> self.name =
name<BR> self.uponwield =
''<BR> <BR>p =
Player('david')</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>sord = Thing('sword')<BR>sord.uponwield = 'the
sword glows '<BR>hat =
Thing('hat')<BR>p.inventory.append(sword)<BR>p.inventory.append(hat)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV></BODY></HTML>