>>311 SUGGESTIONS learn sockets, expand your (MudOS inspired?) text game into a MUD
learn some natural language processing and improve the command parser. python's NLTK would be a good starting point.
http://www.nltk.org/ SOURCE CODE RATING 1. your code needs more try/catch. for example, I can't smoke the egg:
>smoke wierd_egg
Traceback (most recent call last):
File "__init__.py", line 67, in <module>
playerInput.inputHandle()
File "/home/dicks/textKind/playerInput.py", line 39, in inputHandle
passThrough(command, inp, storeError)
File "/home/dicks/textKind/playerInput.py", line 51, in passThrough
consume(inp[1:])
File "/home/dicks/textKind/playerInput.py", line 100, in consume
player.user.removeItem(eval('element.' + array[i]))
File "/home/dicks/textKind/player.py", line 127, in removeItem
self.inventory.remove(thing)
ValueError: list.remove(x): x not in list
2.
> 2014> using evalimo rewrite elements to use a dictionary instead of relying on eval('element.'+id+'.property')
3. you have code like this in a few places
for i in range(len(array)):
if array[i] in element.allElements:
nigger are you serious. consider the following:
for item in array:
if item in element.allElements:
in general you might like to look up some of the python protocol stuff. shit like defining __getitem__ and __iter__ methods on classes. you could use such methods to trim complexity in a few places.
(also, in the bit I quoted, where you have deep nested if/else blocks, I would personally use try/catch and have functions that throw NoSuchThingException etc)
4.
you could use list comprehensions to write tighter code in a few places, e.g.:
for i in player.user.inventory:
if i.type == 'weapon':
weapArray.append(i.name)
becomes
weapArray = [i.name for i in player.user.inventory if i.type == 'weapon']
weapArray.append(i.name)
tl;dr it looks like you already know a different programming language and are trying to write python using old habits from it. I don't like the idea that code should be 'Pythonic' because it sounds weird and cult-like, but you might benefit from reading up on it for comparison's sake if nothing else. keep studying and you'll be a pro in no time.