Execute Brain****/Brat: Difference between revisions

m
Fixed syntax highlighting.
(Brat BF interpreter)
 
m (Fixed syntax highlighting.)
 
(One intermediate revision by one other user not shown)
Line 4:
Does not handle EOF when getting input. Tape is "infinite" in the positive direction. Each cell holds an integer.
 
<langsyntaxhighlight lang="brat">#BF machine
bf = object.new
 
Line 26:
 
#Run instructions
bf.prototype.run = {
current_instruction = null
 
Line 76:
 
#Precalcuate '[' and ']' jump locations
bf.prototype.calculate_jumps = {
forwards = []
jumps = [:]
Line 95:
include :file
 
bf.new(file.read(ask "BF file: ").dice).run</langsyntaxhighlight>
9,485

edits