Skip to main content
deleted 3 characters in body
Source Link
Rod
  • 18.6k
  • 4
  • 32
  • 89

Python 2, 226 224 204204 193 bytes

-1 byte thanks to Trelzevir

x,s,n=input() j=''.join g=lambda x,i:[eval("_"j(_.replacesplit(' ','')).%sjust(len(_))"%['l','r'][i%2]"%'lr'[i%2])for _ in x] for i in([0,3,1,2]*n)[s:s+n]:x=i<2and mapx=[map(''.joinj,zip(*g(map(''.joinj,zip(*x)),i)))or ,g(x,i);print'\n'][i>1];print'\n'.join(x) 

Try it online!Try it online!

Function that remove all spaces of each element in the list and complete with spaces on left or right.

g=lambda x,i:[eval("_"''.replacejoin(_.split(' ','')).%sjust(len(_))"%['l','r'][i%2]"%'lr'[i%2])for _ in x] 

This to transpose (rotate 90º) when the input is 0 or 1(U or D) and apply g

x=i<2and mapx=[map(''.join,zip(*g(map(''.join,zip(*x)),i)))or ,g(x,i)][i>1] 

Python 2, 226 224 204 bytes

-1 byte thanks to Trelzevir

x,s,n=input() g=lambda x,i:[eval("_.replace(' ','').%sjust(len(_))"%['l','r'][i%2])for _ in x] for i in([0,3,1,2]*n)[s:s+n]:x=i<2and map(''.join,zip(*g(map(''.join,zip(*x)),i)))or g(x,i);print'\n'.join(x) 

Try it online!

Function that remove all spaces of each element in the list and complete with spaces on left or right.

g=lambda x,i:[eval("_.replace(' ','').%sjust(len(_))"%['l','r'][i%2])for _ in x] 

This to transpose (rotate 90º) when the input is 0 or 1(U or D) and apply g

x=i<2and map(''.join,zip(*g(map(''.join,zip(*x)),i)))or g(x,i) 

Python 2, 226 224 204 193 bytes

-1 byte thanks to Trelzevir

x,s,n=input() j=''.join g=lambda x,i:[eval("j(_.split(' ')).%sjust(len(_))"%'lr'[i%2])for _ in x] for i in([0,3,1,2]*n)[s:s+n]:x=[map(j,zip(*g(map(j,zip(*x)),i))),g(x,i)][i>1];print'\n'.join(x) 

Try it online!

Function that remove all spaces of each element in the list and complete with spaces on left or right.

g=lambda x,i:[eval("''.join(_.split(' ')).%sjust(len(_))"%'lr'[i%2])for _ in x] 

This to transpose (rotate 90º) when the input is 0 or 1(U or D) and apply g

x=[map(''.join,zip(*g(map(''.join,zip(*x)),i))),g(x,i)][i>1] 
added 1 character in body
Source Link
Rod
  • 18.6k
  • 4
  • 32
  • 89

Python 2, 226 224 204 bytes

-1 byte thanks to Trelzevir

x,is,n=input() g=lambda x,i:[eval("_.replace(' ','').%sjust(len(_))"%['l','r'][i%2])for _ in x] for i in([0,3,1,2]*n)[i[s:i+n]s+n]:x=i<2and map(''.join,zip(*g(map(''.join,zip(*x)),i)))or g(x,i);print'\n'.join(x) 

Try it online!Try it online!

Function that remove all spaces of each element in the list and complete with spaces on left or right.

g=lambda x,i:[eval("_.replace(' ','').%sjust(len(_))"%['l','r'][i%2])for _ in x] 

This to transpose (rotate 90º) when the input is 0 or 1(U or D) and apply g

x=i<2and map(''.join,zip(*g(map(''.join,zip(*x)),i)))or g(x,i) 

Python 2, 226 224 204 bytes

-1 byte thanks to Trelzevir

x,i,n=input() g=lambda x,i:[eval("_.replace(' ','').%sjust(len(_))"%['l','r'][i%2])for _ in x] for i in([0,3,1,2]*n)[i:i+n]:x=i<2and map(''.join,zip(*g(map(''.join,zip(*x)),i)))or g(x,i);print'\n'.join(x) 

Try it online!

Function that remove all spaces of each element in the list and complete with spaces on left or right.

g=lambda x,i:[eval("_.replace(' ','').%sjust(len(_))"%['l','r'][i%2])for _ in x] 

This to transpose (rotate 90º) when the input is 0 or 1(U or D) and apply g

x=i<2and map(''.join,zip(*g(map(''.join,zip(*x)),i)))or g(x,i) 

Python 2, 226 224 204 bytes

-1 byte thanks to Trelzevir

x,s,n=input() g=lambda x,i:[eval("_.replace(' ','').%sjust(len(_))"%['l','r'][i%2])for _ in x] for i in([0,3,1,2]*n)[s:s+n]:x=i<2and map(''.join,zip(*g(map(''.join,zip(*x)),i)))or g(x,i);print'\n'.join(x) 

Try it online!

Function that remove all spaces of each element in the list and complete with spaces on left or right.

g=lambda x,i:[eval("_.replace(' ','').%sjust(len(_))"%['l','r'][i%2])for _ in x] 

This to transpose (rotate 90º) when the input is 0 or 1(U or D) and apply g

x=i<2and map(''.join,zip(*g(map(''.join,zip(*x)),i)))or g(x,i) 
added 6 characters in body
Source Link
mbomb007
  • 23.6k
  • 7
  • 66
  • 143

Python 2, 226 224 204 bytes

-1 byte thanks to Trelzevir

x,i,n=input() g=lambda x,i:[eval("_.replace(' ','').%sjust(len(_))"%['l','r'][i%2])for _ in x] for i in([0,3,1,2]*n)[i:i+n]:x=i<2and map(''.join,zip(*g(map(''.join,zip(*x)),i)))or g(x,i);print'\n'.join(x) 

Try it online! Function

Function that remove all spaces of each element in the list and complete with spaces on left or right.

g=lambda x,i:[eval("_.replace(' ','').%sjust(len(_))"%['l','r'][i%2])for _ in x] 

This to transpose (rotate 90º) when the input is 0 or 1(U or D) and apply g

x=i<2and map(''.join,zip(*g(map(''.join,zip(*x)),i)))or g(x,i) 

Python 2, 226 224 204 bytes

-1 byte thanks to Trelzevir

x,i,n=input() g=lambda x,i:[eval("_.replace(' ','').%sjust(len(_))"%['l','r'][i%2])for _ in x] for i in([0,3,1,2]*n)[i:i+n]:x=i<2and map(''.join,zip(*g(map(''.join,zip(*x)),i)))or g(x,i);print'\n'.join(x) 

Try it online! Function that remove all spaces of each element in the list and complete with spaces on left or right.

g=lambda x,i:[eval("_.replace(' ','').%sjust(len(_))"%['l','r'][i%2])for _ in x] 

This to transpose (rotate 90º) when the input is 0 or 1(U or D) and apply g

x=i<2and map(''.join,zip(*g(map(''.join,zip(*x)),i)))or g(x,i) 

Python 2, 226 224 204 bytes

-1 byte thanks to Trelzevir

x,i,n=input() g=lambda x,i:[eval("_.replace(' ','').%sjust(len(_))"%['l','r'][i%2])for _ in x] for i in([0,3,1,2]*n)[i:i+n]:x=i<2and map(''.join,zip(*g(map(''.join,zip(*x)),i)))or g(x,i);print'\n'.join(x) 

Try it online!

Function that remove all spaces of each element in the list and complete with spaces on left or right.

g=lambda x,i:[eval("_.replace(' ','').%sjust(len(_))"%['l','r'][i%2])for _ in x] 

This to transpose (rotate 90º) when the input is 0 or 1(U or D) and apply g

x=i<2and map(''.join,zip(*g(map(''.join,zip(*x)),i)))or g(x,i) 
deleted 39 characters in body
Source Link
Rod
  • 18.6k
  • 4
  • 32
  • 89
Loading
added 362 characters in body
Source Link
Rod
  • 18.6k
  • 4
  • 32
  • 89
Loading
Source Link
Rod
  • 18.6k
  • 4
  • 32
  • 89
Loading