fork download
  1. import re
  2.  
  3. f=lambda I:re.sub('^\s*(?m)',lambda m:'/'+'*'*len(m.group()[:-2])+'/',re.sub('\t+',lambda g:' '*4*len(g.group()),I))
  4.  
  5. s="""Calculate the value 256 and test if it's zero
  6. If the interpreter errors on overflow this is where it'll happen
  7. ++++++++[>++++++++<-]>[<++++>-]
  8. +<[>-<
  9. Not zero so multiply by 256 again to get 65536
  10. [>++++<-]>[<++++++++>-]<[>++++++++<-]
  11. +>[>
  12. # Print "32"
  13. ++++++++++[>+++++<-]>+.-.[-]<
  14. <[-]<->] <[>>
  15. # Print "16"
  16. +++++++[>+++++++<-]>.+++++.[-]<
  17. <<-]] >[>
  18. # Print "8"
  19. ++++++++[>+++++++<-]>.[-]<
  20. <-]<
  21. # Print " bit cells\n"
  22. +++++++++++[>+++>+++++++++>+++++++++>+<<<<-]>-.>-.+++++++.+++++++++++.<.
  23. >>.++.+++++++..<-.>>-
  24. Clean up used cells.
  25. [[-]<]l
  26. \tthis is preceded by a tab
  27. \t\ttwo tabs
  28. \t\t\tthree tabs etcetera!"""
  29.  
  30. print(f(s))
Success #stdin #stdout 0.02s 9992KB
stdin
Standard input is empty
stdout
//Calculate the value 256 and test if it's zero
//If the interpreter errors on overflow this is where it'll happen
//++++++++[>++++++++<-]>[<++++>-]
//+<[>-<
/**/Not zero so multiply by 256 again to get 65536
/**/[>++++<-]>[<++++++++>-]<[>++++++++<-]
/**/+>[>
/******/# Print "32"
/******/++++++++++[>+++++<-]>+.-.[-]<
/**/<[-]<->] <[>>
/******/# Print "16"
/******/+++++++[>+++++++<-]>.+++++.[-]<
//<<-]] >[>
/**/# Print "8"
/**/++++++++[>+++++++<-]>.[-]<
//<-]<
//# Print " bit cells
//"
//+++++++++++[>+++>+++++++++>+++++++++>+<<<<-]>-.>-.+++++++.+++++++++++.<.
//>>.++.+++++++..<-.>>-
//Clean up used cells.
//[[-]<]l
/**/this is preceded by a tab
/******/two tabs
/**********/three tabs etcetera!