https://github.com/irskep/rum
Enhanced brainf*ck interpreter in Python with string support and more
https://github.com/irskep/rum
Last synced: 3 months ago
JSON representation
Enhanced brainf*ck interpreter in Python with string support and more
- Host: GitHub
- URL: https://github.com/irskep/rum
- Owner: irskep
- Created: 2009-02-01T02:49:54.000Z (over 16 years ago)
- Default Branch: master
- Last Pushed: 2009-03-26T02:26:40.000Z (over 16 years ago)
- Last Synced: 2023-04-13T11:42:27.425Z (over 2 years ago)
- Language: Python
- Homepage:
- Size: 89.8 KB
- Stars: 10
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.txt
Awesome Lists containing this project
README
RUM User Manual
v0.1RUM (bRainfUck iMproved) is a Brainfuck interpreter with Extra Features! It supports 0, -1, and 'ignore' EOF types, as well as an arbitrarily bounded (or unbounded) tape length. It also supports strings, numbered repetitions, and comments.
===========
= Strings =
===========
The following program converts the string "helloworld" to uppercase:
"helloworld",[--------------------------------.,]Strings are null-terminated.
===============
= Repetitions =
===============
You can repeat a command n times by preceding that command with a number. Using this feature, we can significantly shorten the 'helloworld' program:
"helloworld",[32-.,]==============
= Procedures =
==============
Procedures are defined by parentheses, pbrain-style. For example, +([-]) puts a procedure that resets the current cell to zero in slot 1. Use : to call the procedure denoted by the value of the current cell.For example, to print out HELLOWORLD twice:
+(,[32-.,])"helloworld":+:
In this example, we store the function "helloworld",[32-.,] in slot 1 and call it immediately. Since strings are null-terminated, we need to increment the cell once more to call the procedure again.Since the uppercase function will not work on punctuation, we can use procedures to uppercase individual words:
+(,[.,])+(,[32-.,])"hello":[-]+", ":[-]++"world":
In this example, procedure 1 is essentially a print function, and procedure 2 is the uppercase function from earlier. With comments:
+(,[.,]) #procedure 1 is print
+(,[32-.,]) #procedure 2 is print-uppercase
"hello": #print 'HELLO'
", "[-]+: #print ', '
"world"[-]++: #print 'WORLD'===============
= Breakpoints =
===============
To set a breakpoint for RumBottle to handle, use !.============
= Comments =
============
Comment out lines until the next LF with #. Please use discretion when putting punctuation in comments, as I have not tested it at all.RUM is in the public domain.