commit 461bce052b85220d10217e0934dc20e4fae15e1d Spenser Truex <spensertruexonline@gmail.com> 2016-02-15 20:45:53 -0800 Capitalization
README.md | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/README.md b/README.md index 4cc31b3..0906fb0 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,17 @@ # Lisp Fuck -Lisp Fuck is a simple brainfuck interpreter written in Common Lisp. It comes with the best debugging environment for Brainfuck there is. +Lisp Fuck is a simple Brainfuck interpreter written in Common Lisp. It comes with the best debugging environment for Brainfuck there is. #Brainfuck Brainfuck is an esoteric programming language that works on a theoretical byte tape (the Universal Turing Machine). The commands are: ``` -> Move to the next byte right -< Move to the next byte left -. Print the current byte using ASCII -, Read a character of input into this byte -+ Increment this byte's value by one -- Decrement this byte's value by one (that is, subtract one from this byte and set the byte to it) -[ Start a loop. It will be skipped if the current byte is zero, and if not it will terminate at the following "]" when the cell is finally set to zero. +> Move to the next byte on the right. +< Move to the next byte on the left. +. Print the current byte using ASCII. +, Read a character of input into this byte. ++ Increment this byte's value by one. If the cell value is 255 then set it to 0. +- Decrease the value of this cell by one. If the cell value is 0 then set it to 255. +[ Start a loop. It will be skipped if the current byte is zero, and if not it will terminate at the + following "]" when the cell is finally set to zero. ] Delimit the end of a loop. Any other character is considered a "comment" meaning it does nothing. ``` @@ -35,7 +36,7 @@ me@linux:~/common-lisp$ git clone https://github.com/equwal/LispFuck.git > (asdf:load-system :brain) ``` -If everything runs smoothly you will be ready to brainfuck. If there are issues then please *let it be known*. Now one must chooses between the `brain:fuck` and the `#F` notation when using the REPL. The `#F` notation is more concise but does not allow any whitespace in the brainfuck code, while the `brain:fuck` notation allows any character except for an unescaped literal quote `"` inside of the brainfuck code. Below they are both shown: +If everything runs smoothly you will be ready to Brainfuck. If there are issues then please *let it be known*. Now one must chooses between the `brain:fuck` and the `#F` notation when using the REPL. The `#F` notation is more concise but does not allow any whitespace in the Brainfuck code, while the `brain:fuck` notation allows any character except for an unescaped literal quote `"` inside of the Brainfuck code. Below they are both shown: ``` > (brain:fuck ".+[.+] Please escape your \" characters!") "� @@ -43,7 +44,7 @@ If everything runs smoothly you will be ready to brainfuck. If there are issues !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" ``` ``` -> #f.+[.+] <This is not inside the brainfuck code, nor is + or [-].> +> #f.+[.+] [<This is not inside the Brainfuck code, nor is + or -.>] "� !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" @@ -51,9 +52,9 @@ If everything runs smoothly you will be ready to brainfuck. If there are issues #Debugging Brainfuck -Debugging brainfuck code can be done using all the normal Common Lisp functions: `step`, `trace`, `time`, etc. The following functions and variables are exported to the user and may be useful for debugging brainfuck code: +Debugging Brainfuck code can be done using all the normal Common Lisp functions: `step`, `trace`, `time`, etc. The following functions and variables are exported to the user and may be useful for debugging Brainfuck code: ``` -brain:fuck ;Used to execute a brainfuck string directly +brain:fuck ;Used to execute a Brainfuck string directly brain:*tape-size-default* ;Number of cells in the tape Default: 30,000 brain:decf-byte ;The - operator function brain:incf-byte ;The + operator function @@ -62,12 +63,12 @@ brain:print-this-byte ;The . operator function brain:right-shift ;The > operator function brain:left-shift ;The < operator function brain:one-off-fuck ;Function called to loop over each character in the code -brain:*separators* ;Characters that terminate #F brainfuck code Default: (#\Space, #\Newline) +brain:*separators* ;Characters that terminate #F Brainfuck code Default: (#\Space, #\Newline) brain:byte-value ;Returns the value of the curren byte at the *pointer* position brain:*tape* ;Returns the entire tape brain:*pointer* ;The current position in the byte tape. Useful with byte-value Default: Exactly in the middle of the tape. (15,000) ``` -Note that the variables `*tape*` and `*pointer*` are reset upon executing new brainfuck code. Once the execution is finished their state is frozen in time and ready to be viewed. +Note that the variables `*tape*` and `*pointer*` are reset upon executing new Brainfuck code. Once the execution is finished their state is frozen in time and ready to be viewed. #Examples for Debugging: Suppose you want to make the tape only 10 bytes long (instead of the default 30000) This way you can easily view the tape contents after execution: