PageRenderTime 45ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/brainfuck-minifier/index.html

http://github.com/mathiasbynens/mothereffingcssescapes
HTML | 45 lines | 45 code | 0 blank | 0 comment | 0 complexity | d6e199f608925bdae7a3b7e0d27f9e18 MD5 | raw file
  1. <!DOCTYPE html>
  2. <html lang=en>
  3. <meta charset=utf-8>
  4. <title>Brainfuck minifier</title>
  5. <meta name=viewport content="width=device-width,initial-scale=1">
  6. <link rel=stylesheet href=eff.css>
  7. <meta name=description content="An on-the-fly brainfuck minifier.">
  8. <h1>Brainfuck minifier</h1>
  9. <noscript><strong>To use this tool, please <a href=http://enable-javascript.com/>enable JavaScript</a> and reload the page.</strong></noscript>
  10. <h2>Input</h2>
  11. <textarea autofocus>+++++ +++++ initialize counter (cell #0) to 10
  12. [ use loop to set the next four cells to 70/100/30/10
  13. > +++++ ++ add 7 to cell #1
  14. > +++++ +++++ add 10 to cell #2
  15. > +++ add 3 to cell #3
  16. > + add 1 to cell #4
  17. &lt;&lt;&lt;&lt; - decrement counter (cell #0)
  18. ]
  19. > ++ . print 'H'
  20. > + . print 'e'
  21. +++++ ++ . print 'l'
  22. . print 'l'
  23. +++ . print 'o'
  24. > ++ . print ' '
  25. &lt;&lt; +++++ +++++ +++++ . print 'W'
  26. > . print 'o'
  27. +++ . print 'r'
  28. ----- - . print 'l'
  29. ----- --- . print 'd'
  30. > + . print '!'
  31. > . print '\n'</textarea>
  32. <h2>Minified result (<a href=#%E2%82%AC id=permalink>permalink</a>)</h2>
  33. <pre><code id=output>++++++++++[>+++++++>++++++++++>+++>+&lt;&lt;&lt;&lt;-]>++.>+.+++++++..+++.>++.&lt;&lt;+++++++++++++++.>.+++.------.--------.>+.>.</code></pre>
  34. <dl>
  35. <dt>Before
  36. <dd>1,082 bytes
  37. <dt>After
  38. <dd>111 bytes
  39. <dt>Compression ratio
  40. <dd>89.74%
  41. </dl>
  42. <h2>About brainfuck</h2>
  43. <p><a href=http://esolangs.org/wiki/Brainfuck>Brainfuck</a> <i>(not capitalized except at the start of a sentence)</i> is an esoteric programming language. It has eight commands — <code>+-&lt;>[],.</code> — and ignores all other characters. As a result, no special syntax for comments is needed, as long as the comments don’t contain the command characters.
  44. <p id=footer>Made by <a href=https://mathiasbynens.be/>@mathias</a> — <a href=https://github.com/mathiasbynens/mothereff.in/tree/master/brainfuck-minifier>fork this on GitHub!</a></p>
  45. <script src=eff.js></script>