├── .htaccess
├── index.php
├── README.md
├── LICENSE
├── arrays.js
├── index.html
└── new.html
/.htaccess:
--------------------------------------------------------------------------------
1 | DirectoryIndex index.php
2 |
--------------------------------------------------------------------------------
/index.php:
--------------------------------------------------------------------------------
1 |
2 | $page = file_get_contents('index.html');
3 |
4 | $nav = capture('/var/www/cal/iamcal.com/templates/universal_nav.txt');
5 | $track = capture('/var/www/cal/iamcal.com/templates/universal_tracker.txt');
6 |
7 | $page = str_replace('', $nav, $page);
8 | $page = str_replace('', $track, $page);
9 |
10 | echo $page;
11 |
12 |
13 | function capture($path){
14 | ob_start();
15 | include($path);
16 | $out = ob_get_contents();
17 | ob_end_clean();
18 | return $out;
19 | }
20 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Javascript Brainfuck Interpreter / Debugger
2 |
3 | Brainfuck is an esoteric toy programming language
4 | which can be used to teach some software engineering principals, but is mostly used to produce very
5 | complex-looking programs that do very simple things.
6 |
7 | This project is a web-based debugger for Brainfuck, created in 2002 when the world was young.
8 |
9 | You can play with it online at http://www.iamcal.com/misc/bf_debug/
10 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 Cal Henderson
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/arrays.js:
--------------------------------------------------------------------------------
1 | //
2 | // arrays.js - part of the fq engine
3 | // (c)2000-2002 Cal Henderson and Elliot Brady
4 | //
5 | // Array extensions
6 | //
7 |
8 | //
9 | // array.shift removes the first element of an array and returns it
10 | //
11 |
12 | if (typeof(Array.shift) == 'undefined'){
13 | Array.prototype.shift = function ArrayShift(){
14 | var first = this[0];
15 | for (var i=0; i
2 |
3 | Javascript Brainfuck Interpreter / Debugger
4 |
5 |
472 |
506 |
507 |
508 |
509 |
510 |
511 |