Skip to content

Instantly share code, notes, and snippets.

@standy66
Created January 11, 2016 00:19
Show Gist options
  • Select an option

  • Save standy66/12bc757098bbe801803d to your computer and use it in GitHub Desktop.

Select an option

Save standy66/12bc757098bbe801803d to your computer and use it in GitHub Desktop.
Python matrix generator
#! /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