文件名称:Penalties-game
介绍说明--下载内容均来自于网络,请自行研究使用
先说一下方向的设定。我的想法比较简单,就是左中右三个方向,用字符串来表示。射门或者扑救的时候,直接输入方向。所以这里我准备用raw_input。有同学是用1-8的数字来表示八个方向,每次输入一个数字,这也是可以的。不过这样守门员要扑住的概率可就小多了。
至于电脑随机挑选方向,如果你是用数字表示,就用我们之前讲过的randint来随机就行。不过我这次打算用random的另一个方法:choice。它的作用是从一个list中随机挑选一个元素。
-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.
至于电脑随机挑选方向,如果你是用数字表示,就用我们之前讲过的randint来随机就行。不过我这次打算用random的另一个方法:choice。它的作用是从一个list中随机挑选一个元素。
-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.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Penalties game