brainfuck.php 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <div class="container">
  2. <div class="textContainer">
  3. Brainfuck is an esoteric programming language, consisting of only 8
  4. instructions each represented by one character. Every other character
  5. is silently ignored and can be used as comment.
  6. </div>
  7. <div class="row">
  8. <div class="col-md-auto">
  9. <div class="textContainer spacer center">&gt;</div>
  10. </div>
  11. <div class="col">
  12. <div class="textContainer">move the active memory cell to the right</div>
  13. </div>
  14. </div>
  15. <div class="row">
  16. <div class="col-md-auto">
  17. <div class="textContainer spacer center">&lt;</div>
  18. </div>
  19. <div class="col">
  20. <div class="textContainer">move the active memory cell to the left</div>
  21. </div>
  22. </div>
  23. <div class="row">
  24. <div class="col-md-auto">
  25. <div class="textContainer spacer center">+</div>
  26. </div>
  27. <div class="col">
  28. <div class="textContainer">increase the value in the active memory cell</div>
  29. </div>
  30. </div>
  31. <div class="row">
  32. <div class="col-md-auto">
  33. <div class="textContainer spacer center">-</div>
  34. </div>
  35. <div class="col">
  36. <div class="textContainer">decrease the value in the active memory cell</div>
  37. </div>
  38. </div>
  39. <div class="row">
  40. <div class="col-md-auto">
  41. <div class="textContainer spacer center">.</div>
  42. </div>
  43. <div class="col">
  44. <div class="textContainer">print the value in the active memory cell as character</div>
  45. </div>
  46. </div>
  47. <div class="row">
  48. <div class="col-md-auto">
  49. <div class="textContainer spacer center">,</div>
  50. </div>
  51. <div class="col">
  52. <div class="textContainer">read one charater as input storing its value in the active memory cell (not implemented)</div>
  53. </div>
  54. </div>
  55. <div class="row">
  56. <div class="col-md-auto">
  57. <div class="textContainer spacer center">[</div>
  58. </div>
  59. <div class="col">
  60. <div class="textContainer">if the value of the active memory cell is 0, jump to the next ]</div>
  61. </div>
  62. </div>
  63. <div class="row">
  64. <div class="col-md-auto">
  65. <div class="textContainer spacer center">]</div>
  66. </div>
  67. <div class="col">
  68. <div class="textContainer">if the value of the active memory cell is not 0, jump to the previous [</div>
  69. </div>
  70. </div>
  71. <div class="brainfuckTitle">Memory Table</div>
  72. <div id="memorytable"></div>
  73. <div class="row">
  74. <div class="col-lg">
  75. <div class="brainfuckTitle">Input</div>
  76. <textarea id="input">++++--+++>++>>++</textarea>
  77. </div>
  78. <div class="col-lg">
  79. <div class="brainfuckTitle">Executing Code</div>
  80. <div id="outputcode"></div>
  81. </div>
  82. <div class="col-lg">
  83. <div class="brainfuckTitle">Output</div>
  84. <div id="output"></div>
  85. </div>
  86. </div>
  87. <script src="js/brainfuck.js"></script>
  88. <button id="start" onClick="start()" class="btn">Start</button>
  89. <button id="reset" onClick="reset()" class="btn">Reset</button>
  90. <div style="clear: both;"></div>
  91. <div id="delaydiv"><input type="range" min="1" max="1000" value="50" id="delay"></div>
  92. </div>