summaryrefslogtreecommitdiff
path: root/8a.py
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2017-12-02 09:30:07 +0100
committertomsmeding <tom.smeding@gmail.com>2017-12-02 09:30:07 +0100
commit2c1dccf57d7ad5e25e79063dea41fd7bfa9d9ac6 (patch)
tree6c36355ef1a475f2b7cf388402afc96a16588d3d /8a.py
parent2d02f553aa4cc4ded630628eccdf34f55937cee5 (diff)
Move 2016 to its own folder
Diffstat (limited to '8a.py')
-rwxr-xr-x8a.py31
1 files changed, 0 insertions, 31 deletions
diff --git a/8a.py b/8a.py
deleted file mode 100755
index 3ba44b0..0000000
--- a/8a.py
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/usr/bin/env python3
-
-import sys
-
-WID=50
-HEI=6
-
-screen=[[0]*WID for _ in range(HEI)]
-
-for line in sys.stdin:
- line=line.split(" ")
- if line[0]=="rect":
- w,h=[int(x) for x in line[1].split("x")]
- for y in range(h):
- screen[y][:w]=[1]*w
- elif line[0]=="rotate" and line[1]=="row":
- y=int(line[2][2:])
- off=int(line[4])%WID
- part=screen[y][:-off]
- screen[y][:off]=screen[y][-off:]
- screen[y][off:]=part
- elif line[0]=="rotate" and line[1]=="column":
- x=int(line[2][2:])
- off=int(line[4])%HEI
- part=[row[x] for row in screen[:-off]]
- for y in range(off):
- screen[y][x]=screen[-off+y][x]
- for y in range(len(part)):
- screen[off+y][x]=part[y]
-
-print(sum(map(sum,screen)))