Advertisement
Guest User

Untitled

a guest
Dec 21st, 2020
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. from random import randint
  2. for i in range(15):
  3. N = 10
  4. x = list(range(0, N))
  5. y = list(range(-1, N))
  6. mat = [[0 for j in range(N)] for j in range(N)]
  7. for i in range(0, N):
  8. xrand = randint(0, N-i-1)
  9. yrand = randint(1, N-i)
  10. mat[x[xrand]][y[yrand]] = 1
  11. x.pop(xrand)
  12. y.pop(yrand)
  13. for i in mat:
  14. print(i)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement