Created
March 6, 2016 17:17
-
-
Save abatilo/755356c5458000255bcb to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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