├── .htaccess ├── index.php ├── README.md ├── LICENSE ├── arrays.js ├── index.html └── new.html /.htaccess: -------------------------------------------------------------------------------- 1 | DirectoryIndex index.php 2 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | ', $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 |
512 | 513 |
514 | 515 | 516 | 517 | 525 | 526 | 527 | 549 | 576 | 577 | 578 | 581 | 582 |
518 |

Javascript Brainfuck Interpreter / Debugger

519 | By Cal Henderson 520 | | 521 | Source available on Github 522 |
523 |
524 |
528 | Program:
529 |
536 |
537 |
538 | 539 | Input:
540 | Prompt for input as needed
541 | Pre-supply input:
542 |
543 |
544 | 545 | Output:
546 |
547 |
548 |
550 |
551 | 552 | 553 | 554 | 555 |
556 |
557 | 558 | Source Viewer:
559 |
 
560 |
561 | 562 | Memory Viewer:
563 |
 
564 |
565 | 566 | Input Viewer:
567 |
 
568 |
569 | 570 | Output Viewer:
571 |
 
572 |
573 | 574 | Note: The hash ("#") character marks a breakpoint. 575 |
579 | Example programs taken from the Brainfuck Archive 580 |
583 | 584 |
585 | 586 |
587 | 588 | 589 | 590 | 591 | 592 | -------------------------------------------------------------------------------- /new.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Javascript Brainfuck Interpreter / Debugger 4 | 5 | 502 | 547 | 548 | 549 | 550 | 551 | 552 |
553 | 554 |
555 | 556 | 557 | 558 | 563 | 564 | 565 | 587 | 614 | 615 | 616 | 619 | 620 |
559 |

Javascript Brainfuck Interpreter / Debugger

560 | By Cal Henderson
561 |
562 |
566 | Program:
567 |
574 |
575 |
576 | 577 | Input:
578 | Prompt for input as needed
579 | Pre-supply input:
580 |
581 |
582 | 583 | Output:
584 |
585 |
586 |
588 |
589 | 590 | 591 | 592 | 593 |
594 |
595 | 596 | Source Viewer:
597 |
 
598 |
599 | 600 | Memory Viewer:
601 |

602 |
603 | 604 | Input Viewer:
605 |
 
606 |
607 | 608 | Output Viewer:
609 |
 
610 |
611 | 612 | Note: The hash ("#") character marks a breakpoint. 613 |
617 | Example programs taken from the Brainfuck Archive 618 |
621 | 622 |
623 | 624 |
625 | 626 | 627 | 628 | 629 | 630 | --------------------------------------------------------------------------------