omega-rosetta
aien-dev/omega-rosetta
Brought by drakestapleton
omega-rosetta / tasks / identity-matrix / oracle.py
| 1 | # Independent reference for "Identity matrix" (Python 3, standard library only). |
| 2 | # expected.txt is this program's stdout; omc never produced it. |
| 3 | for k, n in enumerate((1, 3, 6)): |
| 4 | if k: |
| 5 | print() |
| 6 | rows = [[0] * n for _ in range(n)] |
| 7 | for i in range(n): |
| 8 | rows[i][i] = 1 |
| 9 | for r in rows: |
| 10 | print(*r) |