fix: address infinite loops and improve perf

This commit is contained in:
2021-06-16 18:50:18 -04:00
parent d3e72e27be
commit d8d70a8ae5
2 changed files with 95 additions and 34 deletions

41
test.bf
View File

@@ -1 +1,40 @@
,>,>,>,>,<<<<.>.>.>.>.
--->--->>>>->->->>>>>-->>>>>>>>>>>>>>>>>>+>>++++++++++[
<<++[
--<+<<+<<+>>>>[
>[<->>+++>>[-]+++<<<+[<++>>+<--]]+>+++++[>>+++++++++<<-]
>>++++.[-]>>+[<<<<+>>+>>-]<<<<<<[>+<-]<<
]++++++++++.[-]>++
]-->>[-->[-]>]<<[
>>--[
-[
-[
-----[>+>+++++++<<+]-->>-.----->,[<->-]<[[<]+[->>]<-]<[<<,[-]]>>>>
]>
]<[
>-[+<+++]+<+++[+[---->]+<<<<<<[>>]<[-]]
>[<+[---->]++[<]<[>]>[[>]+>+++++++++<<-[<]]]>[>>>>]
]<[
-[[>+>+<<-]>[<+>-]++>+>>]<[<<++[-->>[-]]>[[-]>[<<+>>-]>]]
]<[
[[<<]-[>>]<+<-]>[-<+]<<[<<]-<[>[+>>]>[>]>[-]]
>[[+>>]<-->>[>]+>>>]
]<[
-[
--[+<<<<--[+>[-]>[<<+>+>-]<<[>>+<<-]]++[>]]
<<[>+>+<<-]>--[<+>-]++>>>
]<[<<<[-]+++>[-]>[<+>>>+<<-]+>>>]
]<[
+[[<]<<[<<]-<->>+>[>>]>[>]<-]+[-<+]<++[[>+<-]++<[<<->>+]<++]<
<<<<<< +> > >+> > >+[
<<< ->+>+>+[
<<<<<<< +>->+> > >->->+[
<<<<< ->+>+> >+>+[
<<<< ->->+>->+[
<<<<<<<<+>-> >+> > >->+>+[
<<<<< -> >+> >->+[
<<<< +>->+> >+]]]]]]]
+++[[>+<-]<+++]--->>[-[<->-]<++>>]++[[<->-]>>]>[>]
]<
]
]<
]