half-credit dizzy

This commit is contained in:
Stephen McQuay 2012-09-08 11:44:33 -06:00
parent 1894bb160c
commit eeacab67d4
3 changed files with 34 additions and 0 deletions

20
dizzy/dizzy.py Normal file
View File

@ -0,0 +1,20 @@
import sys
R = int(sys.stdin.readline().strip()) / 90
if R < 0:
R = 4 + R
m = 0
lines = []
for line in sys.stdin:
lines.append(list(line.strip()))
if len(line) > m:
m = len(line)
for line in lines:
line += [' '] * (m - len(line) - 1)
for i in range(R):
lines = zip(*lines[::-1])
for i in lines:
print ''.join(i)

8
dizzy/stdin1.txt Normal file
View File

@ -0,0 +1,8 @@
90
o...o
.o.o.
..o..
..o..
..o..
..o..

6
dizzy/test.py Normal file
View File

@ -0,0 +1,6 @@
-1 -> 3
-2 -> 2
-3 -> 1
-4 -> 0