Created
January 11, 2016 00:19
-
-
Save standy66/12bc757098bbe801803d to your computer and use it in GitHub Desktop.
Python matrix generator
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
| #! /usr/bin/env python3 | |
| import sys | |
| import random | |
| width = int(sys.argv[1]) | |
| height = int(sys.argv[2]) | |
| for i in range(0, width): | |
| for j in range(0, height): | |
| val = random.choice([0, 1]) | |
| print("%d %d\t%d" % (i, j, val)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment