Skip to content

Instantly share code, notes, and snippets.

@abatilo
Created March 6, 2016 17:17
Show Gist options
  • Save abatilo/755356c5458000255bcb to your computer and use it in GitHub Desktop.
Save abatilo/755356c5458000255bcb to your computer and use it in GitHub Desktop.
from random import randint
size = 7
# 1 - 9 just so that monospace fonts look nice
min_dist = 1
max_dist = 9
with open('out.inp', 'w') as f:
f.write(str(size) + '\n')
for i in xrange(size):
for j in xrange(size):
f.write(str(randint(min_dist, max_dist) if i != j else 0) + ' ')
f.write('\n')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment