Skip to content

Instantly share code, notes, and snippets.

@a2chub
Created June 2, 2015 03:37
Show Gist options
  • Save a2chub/841962ead386d410adec to your computer and use it in GitHub Desktop.
Save a2chub/841962ead386d410adec to your computer and use it in GitHub Desktop.
#!/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