#!/usr/bin/python

def lobby():
	cmd = raw_input("""
In the lobby
well its a lobby what else to say
there is a door
[whatis goto lookat quit] # """)
	if cmd == "whatis door":
		print 'its a door you stupid'
	elif cmd == "lookat door":
		print "the door is not lockable"
	elif cmd == "goto door":
		print "you enter the door abd leave the lobby"
		return room
	elif cmd == "quit":
		print "goodbye"
		return None
	return begin6

def room():
	cmd = raw_input("""
the room is empty
return to lobby
[] # """)

def main():
	game = lobby()
	while game:
		game = game()

"""
minimalist game approach above
______________________________
symbolic rpg
  there is no number
    and ut get worst the longer you play
      no any xp hp skill point
        you dont level up

sword vs sheild = nothing
axe vs sheid = axe
bownarrow vs sheild = nothing
fire vs wood = fire

once all tag have been compared.one of them will maybe win

"""

chart = [
{"name":"Normal","immunes":["Ghost"],"weaknesses":["Rock","Steel"],"strengths":[]},
{"name":"Fire","immunes":[],"weaknesses":["Fire","Water","Rock","Dragon"],"strengths":["Grass","Ice","Bug","Steel"]},
{"name":"Water","immunes":[],"weaknesses":["Water","Grass","Dragon"],"strengths":["Fire","Ground","Rock"]},
{"name":"Electric","immunes":["Ground"],"weaknesses":["Electric","Grass","Dragon"],"strengths":["Water","Flying"]},
{"name":"Grass","immunes":[],"weaknesses":["Fire","Grass","Poison","Flying","Bug","Dragon","Steel"],"strengths":["Water","Ground","Rock"]},
{"name":"Ice","immunes":[],"weaknesses":["Fire","Water","Ice","Steel"],"strengths":["Grass","Ground","Flying","Dragon"]},
{"name":"Fighting","immunes":["Ghost"],"weaknesses":["Poison","Flying","Psychic","Bug","Fairy"],"strengths":["Normal","Ice","Rock","Dark","Steel"]},
{"name":"Poison","immunes":["Steel"],"weaknesses":["Poison","Ground","Rock","Ghost"],"strengths":["Grass","Fairy"]},
{"name":"Ground","immunes":["Flying"],"weaknesses":["Grass","Bug"],"strengths":["Fire","Electric","Poison","Rock","Steel"]},
{"name":"Flying","immunes":[],"weaknesses":["Electric","Rock","Steel"],"strengths":["Grass","Fighting","Bug"]},
{"name":"Psychic","immunes":["Dark"],"weaknesses":["Psychic","Steel"],"strengths":["Fighting","Poison"]},
{"name":"Bug","immunes":[],"weaknesses":["Fire","Fighting","Poison","Flying","Ghost","Steel","Fairy"],"strengths":["Grass","Psychic","Dark"]},
{"name":"Rock","immunes":[],"weaknesses":["Fighting","Ground","Steel"],"strengths":["Fire","Ice","Flying","Bug"]},
{"name":"Ghost","immunes":["Normal"],"weaknesses":["Dark"],"strengths":["Psychic","Ghost"]},
{"name":"Dragon","immunes":["Fairy"],"weaknesses":["Steel"],"strengths":["Dragon"]},
{"name":"Dark","immunes":[],"weaknesses":["Fighting","Dark","Fairy"],"strengths":["Psychic","Ghost"]},
{"name":"Steel","immunes":[],"weaknesses":["Fire","Water","Electric","Steel"],"strengths":["Ice","Rock","Fairy"]},
{"name":"Fairy","immunes":[],"weaknesses":["Fire","Poison","Steel"],"strengths":["Fighting","Dragon","Dark"]}]

def cmpAwB(lstA,lstB):
	'''

	>>> [
	...	cmpAwB([A['name']],[B['name']])
	... 	for A in chart
	... 	for B in chart
	...	if A != B
	... ]
	[]
	'''
	strong = [
		spec['name']
		for spec in chart
		for att in lstA
		if spec['name'] == att
		for dff in lstB
		if dff in spec['strengths']
	]
	weak = [
		spec['name']
		for spec in chart
		for att in lstA
		if spec['name'] == att
		for dff in lstB
		if dff in spec['weaknesses']	
	]
	immune = [
		spec['name']
		for spec in chart
		for dff in lstB
		if spec['name'] == dff
		for att in lstA
		if att in spec['immunes']
	]
	return strong,weak,immune



if __name__ == "__main__":
    import doctest
    doctest.testmod()
