Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
43
Task/Execute-Brain-/11l/execute-brain-.11l
Normal file
43
Task/Execute-Brain-/11l/execute-brain-.11l
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
F bf(source)
|
||||
V tape = DefaultDict[Int, Int]()
|
||||
V cell = 0
|
||||
V ptr = 0
|
||||
L ptr < source.len
|
||||
S source[ptr]
|
||||
‘>’
|
||||
cell++
|
||||
‘<’
|
||||
cell--
|
||||
‘+’
|
||||
tape[cell]++
|
||||
‘-’
|
||||
tape[cell]--
|
||||
‘.’
|
||||
:stdout.write(Char(code' tape[cell]))
|
||||
‘,’
|
||||
tape[cell] = :stdin.read(1).code
|
||||
‘[’
|
||||
I tape[cell] == 0
|
||||
V nesting_level = 0
|
||||
L
|
||||
S source[ptr]
|
||||
‘[’
|
||||
nesting_level++
|
||||
‘]’
|
||||
I --nesting_level == 0
|
||||
L.break
|
||||
ptr++
|
||||
‘]’
|
||||
I tape[cell] != 0
|
||||
V nesting_level = 0
|
||||
L
|
||||
S source[ptr]
|
||||
‘[’
|
||||
I --nesting_level == 0
|
||||
L.break
|
||||
‘]’
|
||||
nesting_level++
|
||||
ptr--
|
||||
ptr++
|
||||
|
||||
bf(‘++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.’)
|
||||
Loading…
Add table
Add a link
Reference in a new issue