Introduction - If you have any usage issues, please Google them yourself
Let me talk about setting direction. My idea is simple, that is, three directions left, right, represented by the string. Shooting or fighting when direct input direction. So here I am ready to use raw_input. Some students with 1-8 numbers to represent the eight directions, each time you enter a number, it is possible. However, this probability goalkeeper Puzhu may be much smaller.
As for the computer randomly selected direction, if you are using a digital representation, on the line to use before we talked about the randint randomly. But this time I intend to use another method of random: choice. Its role is randomly selected a list of one element.