[Tutor] RPG wielding

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Mon Dec 5 20:52:21 CET 2005



> hello everyone, and thanks for your help and guidance so far. amazingly
> enough, something i thought would be simple has turned out to be not
> simple. i have a sword that i want to wield. as i have it here, i think
> i am wielding whatever string i type as argument to wield. so i guess i
> need to pass wield an object somehow instead of a string. can anyone
> point in the right direction?

Your player's inventory is a list of items.  One way to make wield() work
right is to hunt through your inventory to see what item matches the
'what'.

Good luck!




More information about the Tutor mailing list