Advertisement
Sp3000

Deformyer golf

Apr 19th, 2015
77
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.92 KB | None
  1. """
  2. Remove space on last line [-1]
  3. import random;random.choice -> from random import*;choice [-1]
  4. {'/':'\\','<':'>','>':'<','\\':'/'} -> dict(zip("\/<>","/\><")) [-11]
  5. reversed -> [::-1]  [-5]
  6. """
  7.  
  8. # 269 bytes:
  9.  
  10. from random import*
  11. m,d=[],dict(zip("\/<>","/\><"))
  12. v=lambda w:[d[x]for x in w]
  13. for e in list('=-/>/-///'):
  14.  if e in d:f=[choice([e,d[e]])for x in[0]*12];t=''.join(f+v(f[::-1]))
  15.  else:t=24*e
  16.  print t;m+=[''.join(v(t)if'/'in t or'\\'in t else t)]
  17. print'\n'.join(m[::-1])
  18.  
  19.  
  20. """
  21. m+=[blah] -> m+=blah, [-1]
  22. v(t)if'/'in t or'\\'in t else t -> e=='/'and v(t)or t [-13]
  23. list('=-/>/-///') -> '=-/>/-///' [-7, no need to make a list]
  24. """
  25.  
  26. # 248 bytes:
  27.  
  28. from random import*
  29. m,d=[],dict(zip("\/<>","/\><"))
  30. v=lambda w:[d[x]for x in w]
  31. for e in'=-/>/-///':
  32.  if e in d:f=[choice([e,d[e]])for x in[0]*12];t=''.join(f+v(f[::-1]))
  33.  else:t=24*e
  34.  print t;m+=''.join(e=='/'and v(t)or t),
  35. print'\n'.join(m[::-1])
Advertisement
RAW Paste Data Copied
Advertisement