Created
June 2, 2015 03:37
-
-
Save a2chub/841962ead386d410adec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#coding:utf-8 | |
import random | |
cnt = 0 | |
tate = 33 | |
yoko = 5 | |
base_list = range(1, tate*yoko+1) | |
random_list = [] | |
flag = True | |
i = 0 | |
while flag: | |
now_num = random.choice( base_list ) | |
if now_num in random_list: | |
pass | |
else: | |
random_list.append(now_num) | |
flag = tate*yoko>len(random_list) | |
i += 1 | |
random_mtx = [] | |
for i in range(tate): | |
col_arr = [] | |
for ii in range(yoko): | |
col_arr.append( random_list[cnt]) | |
cnt += 1 | |
random_mtx.append( col_arr) | |
print random_mtx | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment