From 7f3727c324cd7c679a75aaa0a1a51de1d9ada27a Mon Sep 17 00:00:00 2001 From: hsn <> Date: Tue, 26 Oct 2004 16:20:39 +0000 Subject: [PATCH] added rotate --- contrib/rotate.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 contrib/rotate.py diff --git a/contrib/rotate.py b/contrib/rotate.py new file mode 100644 index 0000000..b7c9ec6 --- /dev/null +++ b/contrib/rotate.py @@ -0,0 +1,22 @@ +import sys +# rotate stdin 90 deg. anticlockwise to stdout +# coded by WaReZ GodZ: +# pizducha + cincila +# at cool winter 1995 +# -* *- E n j o y t h e s c e n e ** -- ** ! +# +# additional tweaking by Kaptain Z in hot 2001 + +input=[] +for line in sys.stdin: + input.append(line.rstrip()) + +maxline=max(map(lambda x: len(x),input)) + +for i in range(maxline-1,-1,-1): + for j in range(len(input)): + if len(input[j])>i: + sys.stdout.write(input[j][i]) + else: + sys.stdout.write(' ') + print