擅长:python、mysql、java
<p>您可以创建一个包含所有坐标的列表,<a href="http://docs.python.org/2/library/random.html#random.shuffle" rel="nofollow">^{<cd1>}</a>该列表并取其中的前60个坐标(10+20+30):</p>
<pre><code>>>> import random
>>> coordinates = [(i, j) for i in xrange(10) for j in xrange(10)]
>>> random.shuffle(coordinates)
>>> coordinates[:60]
[(9, 5), (6, 9), (1, 5), ..., (0, 2), (5, 9), (2, 6)]
</code></pre>
<p>然后,可以使用前10个值插入10个值,后20个值用于插入20个值,剩余的20个值用于插入30个值。在</p>