fork(2) download
  1. def do_twice(f):
  2. f()
  3. f()
  4.  
  5. def do_four(f):
  6. do_twice(f)
  7. do_twice(f)
  8.  
  9. def print_beam():
  10. print('+ - - - -')
  11.  
  12. def print_post():
  13. print('| ')
  14.  
  15. def print_beams():
  16. do_twice(print_beam)
  17. print('+')
  18.  
  19. def print_posts():
  20. do_twice(print_post)
  21. print('|')
  22.  
  23. def print_row():
  24. print_beams()
  25. do_four(print_posts)
  26.  
  27. def print_grid():
  28. do_twice(print_row)
  29. print_beams()
  30.  
  31. print_grid()
Success #stdin #stdout 0.03s 9984KB
stdin
Standard input is empty
stdout
+ - - - -
+ - - - -
+
|        
|        
|
|        
|        
|
|        
|        
|
|        
|        
|
+ - - - -
+ - - - -
+
|        
|        
|
|        
|        
|
|        
|        
|
|        
|        
|
+ - - - -
+ - - - -
+