Browse Source

half-credit dizzy

master
Stephen McQuay 8 years ago
parent
commit
eeacab67d4
3 changed files with 34 additions and 0 deletions
  1. +20
    -0
      dizzy/dizzy.py
  2. +8
    -0
      dizzy/stdin1.txt
  3. +6
    -0
      dizzy/test.py

+ 20
- 0
dizzy/dizzy.py 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
- 0
dizzy/stdin1.txt View File

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

+ 6
- 0
dizzy/test.py View File

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

Loading…
Cancel
Save