half-credit dizzy
This commit is contained in:
parent
1894bb160c
commit
eeacab67d4
20
dizzy/dizzy.py
Normal file
20
dizzy/dizzy.py
Normal 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
8
dizzy/stdin1.txt
Normal file
@ -0,0 +1,8 @@
|
||||
90
|
||||
o...o
|
||||
.o.o.
|
||||
|
||||
..o..
|
||||
..o..
|
||||
..o..
|
||||
..o..
|
6
dizzy/test.py
Normal file
6
dizzy/test.py
Normal file
@ -0,0 +1,6 @@
|
||||
-1 -> 3
|
||||
-2 -> 2
|
||||
-3 -> 1
|
||||
-4 -> 0
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user