Basic Brainfuck Code Optimization

Submit

Your name:
File:
Open code-statistics:

Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.

Problem

Each line of input will be a randomly generated line of Brainfuck code. The task is to reduce and part of it that has either '+' bordering '-' (or the reverse), and '>' bordering '<' (or the reverse).

Example:

+++-->>+>><<-

What gets cut:

+ (++--) >>+ (>><<) -

Leaving:

+>>+-

Notice, now there's still:

+>> (+-)

Remove the +- and you have the requested output:

+>>

Options

exec is denied

now post-mortem time, all source codes will be revealed

Sample input:_

+++-->>+>><<-

Sample output:

+>>

Sample input:_

[-]>[-+++-+---]<>++++++++-----+++++[<>>><<<+++++++++>-]<.>++++[<+++++++>-]<+.+++-------+--++++++++++++..+++.>++++++[<----------->-]<-.------------.>++++++++[<<>>><<+++++++++++>-]<-.--------.+++.------.-----+++-++-------.>++++++[<---+++----------->-]<-.

Sample output:

[-]>[-]++++++++[<+++++++++>-]<.>++++[<+++++++>-]<+.+++++++..+++.>++++++[<----------->-]<-.------------.>++++++++[<+++++++++++>-]<-.--------.+++.------.--------.>++++++[<----------->-]<-.

Sample input:_

+>-[>>-][<+]<>-++>++.>+++>>>>>+<>-+>[[>-]<.]>+>--[]..>>--[+>+<++]--><<>-<>>,<+>><>>-+->>.-+<>+<>
+,+<->+.<+>-+[>+><>-><[<>+>[+><>+,]>->>]->-.-<>-[[>>]+.>+>-]<<-]++<-,--+<<><-+++[]-+>++><>+>-<-
>->><+>.<--+.>.+<+>+--[>-<>>>><][<<>>-<>]--><>->+<><<[+>]<<+<.->-++<+-++<>>>->>+-<-[.]<-,++>
>.+<-+>--><+>>>[>><>>>+<+<]><>>[>-.<+>+<,>+-+<+]><++<<-++<--><[>>[]+<>-+]+>>->--+[+-[][<<-]-]--
>.++>>+--+++++->>,[>]<>-+>.>->-<,>+,>[>+->+>+<]+[<<[><+<<[+]<<+>,+-+.<-]><-+->]+>++.[]->++>-.
+---+<,-[<<]><+<>>,>>>->-+[-+>>+-+<>><><>[>-,]>.-]>><<+--><<>>->>-<<<<+--<>>+-><><++++--<+>+<
<-<<<>+>+.>.<><<>>+[++-[-->+>>>[>-],<.+>]>--+>>++>],><>[]>>+[>>>>[<-+---[>]+<<]->][.-][,]<-<--<+<>
+[]+->>[-<.+<<++-<[>>[-<--.-+[+++-<->>+><-<]>>+>->]>+><[]]-]<<[[]]>>+->++<++><[+++-+.<+]<>+-><+
+<>.>--->>+.+><.[<<,<->-><->>,<[<>[<.-<]>]>>>],---<,<+<+>>>+.+>++<--<>>-<+>>[>+->+[<]<<><<.>-+]>+
[+>,++-+>+<><<]<->.[-+>+>-.->-+-+[[]+>>[>><->+]]]+><<[-][->+>[<+<>]]->>+<+[-++<+-<[>.<->]++++]->
[+[-]----]>++-->-<>><..[+>-+.<<+<[<[+<><]]+[>+->+]>-[]-+[->[]->.]<-[>>+>>+-]-,+]>-<><>++--<>
.>[>[<+>++<-]>[+<+<.><-[<>-]><-+><>>+->]>]>>+.><->>>+>-,.>>+>->+-[,>-->]--<-->>+.+<-++->.++-->>
>>->>,>[>]-,-,<+[>+++>]++-[[<-[]]->+++-<>+--<++>-[+]+++[->-><],,++>[]+]>><>-,.<>-+->>--><,<.->-
>->>--+--<<<-[+<]-+>+<>>><<[]+>[+>+>-+-.><+>.]---+.++--[<+-+->+<+>[-+-<]>]+.<<>>-.-+-->[-]><-+
>--<.--,<--->--++<<[+>>,-><]>-[+><>.+>+<-+--][+>+.+>.>]>>><,-+<+<>,>->-<[++>--[]-->>.>>>>>]->,>
>>++-+-><-+<+-[>.-+>-+>[+.>]>-->->[]>><<++[]<->+>--]--+----+-+>.[>]+>><-,--[<[+--,]><-]>++-><>>+.
++>[-+><>[[->]+.>-+----.><-<[]]]-+++-.>-<>><->>[<>[>--+][>---+]->+]>->><[+-.<-]+<+++>>>-+-+>+
-[>-.]+-<>-->[>+[>+>,<>>]>>]<+>+->[>]<>->>><>>[-+++--><>+>][-]-+>+.>>+->++><->.+>>--<-->>-<>>>+<
+-++<>><><+[>]>.><<>[]+<--->++>-+>---<<<<+-,--+>-.--<[>-<-<+<<+<>>]>>+<>->++><-[<->>+>+<+<<<]
>-+-<.>-[>->.>,-<>+]><+<<+<--<.[]><<<+[+><<[]+>>>>[>->-<++.+>+>>->--<]]>>-.<-<><<-+><>+>>.<-+->>
+>+.<++<.<[+<><.+]<>+>-+<[<]>.<<+[<.[-+--,]--]>-[>>><,<<>>.<-><<><-+++>+<]-[<]+-><<+>>.+>+>-<>
+-.><<>><><--+>-+-<-->[>-<.>-]>>-[[>+<.<>->-]-.[>-><]]-[>,]<+--[---]---.-,+>->-[]-+<>>>++
[+--+>-<>>]<<>+-+.>->+>->>><<<<+.<+->+.>[>[>[-.]-++..>++->><[>]>]--+>--[[]>>,+[->-<-+]>]]>+><..>++
>>>>-[>]+.+>--+--[>+]>>><>>>->[]>[,[-<>][<<<>].>-><<,>->-]++<<><..>>>+[]>-+,[++]>+-++>+-><->+>-,
>>>---<<<[>>+>>.]+++>-,[>>>]>+>.-+>+--,+,[[[[<++><+-<-->],]]>,<-.>,>>+<+->-++>-]>-++->+[+][->>[]]
><-><<,>+-<,+++,>-<--<,+<+>+>[[<>><+---<+.-.>+>>+>+--+->]->]<+<++>>>+<.>+-[+]><-<+-><<><>.-+<
-[]->>[+<>-><+]+-[>-+]<-[+-->++>>>]+>+<->+->->><>>-.+->-[]<><->+>->+>--+>[<><.>]<<<>>>--+>->+>>+
[+<[>-][-++->>>>]>->]>>-<>[->><.+-++>++<+][]>>>>[+->-<>[>+>]><--[.>--]><+-+..>]+><>><<-<><>++-<-
><+->-<--->[+[.++]<>>[+]-]-<[<<>><><->]>[,>]><.>>+<>->>>,<>><-[-->++--->]>><<>++-++>+>>+
->.[]>>-><+>+++<-.>>-[-+[+]+>]>-++>+,.-++.++-<<<><[>-><+>]->[>+>]<<-<>-<[,]><>>[++---<]<>>+.
<+-<.->+-->,><->><+.>>+><><>->++--+<<<<[+[<.++].>-]-[->>>[>->->->[]>>[]+<[<-++>]+>]<+->]-<+->+<+>>+
>-[>+<<[-,-[--->>->-]>+]>--[,<<.>]<+[-><<>.+,>>>->>>++>-++>-+]-[>+-]]+<<++-><+<>>-+>[]-><-<.<
.<+>[-<>>+>>>]--<>->.---+->-,>[+><-<++>-].[+>]>+--<-.><><>-.+->+<<<[]<.++<>>-<.-.>><
+++++.><>++<>>->-<+[->>+<+.][+-<+>-]<>-+<-<<>.<+>+->[>+<-+++>>+[>++<-].]++[-+][>--<]-<>>-->>+>
+>+[-++<[<.[[+,[>++<>].-]]+<+>++-[+]-+->-]+>-<<]>>>>--[<>-.->>->+-+><>+>--]>--.+-->+>[]-->+<<>-->
<-+->>--<>->,>[><<>-[>+>--.+]>]+>>>-+.-[>-+>>[[><>]><[>+>[>-+-]+><--<>>]<>>><>>++]<-<>>>-]<[>]+
.[>.+]+--+-->,.>>>>>+>.<--+<.+>-..>->>>+>+-[>+-[>]+[+>>,[,]-]+>+<><,[>-><>++<[]--]++<++>-][>>>]
,+-+-<+>>>[<>>>,<>>[[>]<]<----+<+.<+++,-<>[>-]>[--<>+>>+]>]<---[+>+-<<>+---<[-+<>>>[-],--]++-]->
-+>,--++>[-.>++-.-<->]>,<>++>->+.<<<<>>>>>-.<[><+]<++<+>>>>>-++.--[]>++><.<+[++<<-]+-<<>++>+><
>>[>>[-[]>.-.>>+<++>,<>+-[->-.]>-[+++.>><-<<++>>.+.--.>]-+->.-]<>]-<+>+--+>+>+>>>>>--+--+->+[-<]
><-->+->+[>+><+[>+><[,-<<><><-->-->>+]]->].+-[+>>]->,><+>-,,->+>-><>-..+..[-->+-]-<[>]-.<>-++>-
-+++.>++<><--+-+<>+[<<]<>+<<+<-<<><<++>>>+.+<>++-><>.[.[>>+>>]<->>>]>+><[]<>-+<+,[.-]+-+<>

Sample output:

+>-[>>-][<+]+>++.>+++>>>>>+>[[>-]<.]>+>--[]..>>--[+>+<++]--->,<+>>>->>.+
+,+<->+.<+>[>+>-[+>[+>+,]>->>]->-.--[[>>]+.>+>-]<<-]++<-,-<<++[]>++>+>-<-
>->+>.<-.>.+<+>-[>->>][-]-->->+<<[+>]<<+<.->+<++>>->-[.]<-,++>
>.>>>[>>>>+<+<]>>[>-.<+>+<,>+<+]++<<+<--[>>[]+]+>>->-[[][<<-]-]--
>.++>>+++>>,[>]>.>->-<,>+,>[>>+>+<]+[<<[+<<[+]<<+>,+.<-]->]+>++.[]->++>-.
-<,-[<<]+>,>>>->[>>+>[>-,]>.-]->->>-<<<<->++<+>+<
<-<<+>+.>.+[+[-->+>>>[>-],<.+>]>->>++>],>[]>>+[>>>>[<---[>]+<<]->][.-][,]<-<--<+
+[]>>[-<.+<<+<[>>[-<--.[++<->]>>+>->]>+[]]-]<<[[]]>>>++<++[+++.<+]+
+.>--->>+.+.[<<,<->-->>,<[[<.-<]>]>>>],---<,<+<+>>>+.+>++<-->-<+>>[>>+[<]<<<.>]>+
[+>,++>+<<]<->.[>+>-.->[[]+>>[>->+]]]+<[-][->+>[<+]]->>+<+[+<<[>.<->]++++]->
[+[-]----]>>-..[+>.<<+<[<[+<]]+[>>+]>-[][->[]->.]<-[>>+>>]-,+]>-
.>[>[<+>++<-]>[+<+<.-[-]>>>]>]>>+.->>>+>-,.>>+>->[,>-->]--<-->>+.+.>>
>>->>,>[>]-,-,<+[>+++>]+[[<-[]]->+<++>-[+]+++[->-],,++>[]+]>>-,.->>--,<.->-
>->>---<<<-[+<]>+[]+>[+>+>-.+>.]--.[+<+>[-<]>]+.-.-->[-]
>--<.--,<---<[+>>,-]>-[+>.+>+<--][+>+.+>.>]>>,<+,>->-<[++>--[]-->>.>>>>>]->,>
>>+<[>.>>[+.>]>-->->[]++[]<->+>--]---->.[>]+>-,--[<[-,]-]>+>>+.
++>[>[[->]+.>----.-<[]]]+.>-->>[[>-][>--]->+]>->[.<-]+<+++>>>>+
-[>-.]-->[>+[>+>,>]>>]<+>>[>]->>>>[>+>][-]>+.>>>+>.+>>--<-->>->>+<
+++[>]>.[]+<--->++>>---<<<<,->-.--<[>-<-<+<<+>]>>>+[<->>+>+<+<<<]
>-<.>-[>->.>,]+<<+<--<.[]<<+[+<[]+>>>>[>->-<++.+>+>>->--<]]>>-.<-<+>>.<->>
+>+.<++<.<[+<.+]+[<]>.<<+[<.[--,]--]>-[>>,.<-<++>+<]-[<]<+>>.+>+>-
.->-<-->[>-<.>-]>>-[[>+<.->-]-.[>-]]-[>,]<-[---]---.-,+>->-[]>>++
[>->]<+.>->+>-<+.+.>[>[>[-.]+..>+>[>]>]->--[[]>>,+[->-<]>]]>+..>++
>>>>-[>]+.+>---[>+]>>>>>->[]>[,[-][<<].>-<,>->-]++<<..>>>+[]>,[++]>++>->+>-,
>>>---<<<[>>+>>.]+++>-,[>>>]>+>.>-,+,[[[[<++<-->],]]>,<-.>,>>++>-]>>+[+][->>[]]
-<,,+++,>-<--<,+<+>+>[[--<+.-.>+>>+>->]->]<+<++>>>+<.>[+]-<.<
-[]->>[+][>]<-[->++>>>]+>+<->>->>>-.>-[]<->+>->+>->[<.>]->->+>>+
[+<[>-][>>>>]>->]>>-[->.++>++<+][]>>>>[>-[>+>]--[.>--]+..>]+<-
>-<--->[+[.++]>[+]-]-<[<->]>[,>].>>>>>,-[-->->]>+++>+>>+
->.[]>>>+++<-.>>-[[+]+>]>+>+,.+.+<<<[>>]->[>+>]<<--<[,]>>[-<]>+.
<<.->->,->+.>>+>->+<<<<[+[<.++].>-]-[->>>[>->->->[]>>[]+<[<+>]+>]]<+>>+
>-[>+<<[-,-[--->>->-]>+]>--[,<<.>]<+[-.+,>>>->>>++>+>]-[>]]+<<++>>[]--<.<
.<+>[->+>>>]--->.--->-,>[<++>-].[+>]>-<-.>-.>+<<<[]<.++>-<.-.>
+++++.>++>->-<+[->>+<+.][<+>-]<-<.<+>>[>+<++>>+[>++<-].]++[][>--<]->-->>+>
+>+[+<[<.[[+,[>++].-]]+<+>+[+]->-]+>-<<]>>>>--[-.->>->+>+>--]>--.->+>[]-->+<-->
<->>--->,>[-[>+>--.+]>]+>>>.-[>>>[[>][>+>[>-]->]>>>++]<->>-]<[>]+
.[>.+]-->,.>>>>>+>.<-<.+>-..>->>>+>[>[>]+[+>>,[,]-]+>+<,[>->++<[]--]++<++>-][>>>]
,<+>>>[>>,>[[>]<]<---<+.<+++,-[>-]>[->>+]>]<---[-<[>>[-],--]+]->
>,>[-.>+.-<->]>,++>->+.>-.<[+]<++<+>>>>>+.--[]>++.<+[++<<-]<++>+
>>[>>[-[]>.-.>>+<++>,[->-.]>-[+++.>-<<++>>.+.--.>]->.-]]-<+>>+>+>>>>>--->+[-<]
-->>+[>++[>+[,-<<-->-->>+]]->].[+>>]->,+>-,,->+>->-..+..[-->]-<[>]-.+>-
++.>++<[<<]+<<+<-<<<++>>>+.++>.[.[>>+>>]<->>>]>+[]<+,[.-]+

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1leonid380.05392014/11/11 20:39:370B / 13B / 23B
2teebee380.04702014/11/12 11:47:460B / 10B / 26B
3Histocrat390.07472014/11/12 07:08:400B / 12B / 25B
4kaki390.04492014/11/23 21:47:200B / 12B / 25B

Perl _

RankUserSizeTimeDateStatistics
1teebee330.04242014/11/11 16:35:530B / 10B / 21B
2tails330.07652014/11/12 09:31:220B / 10B / 21B
3brx330.03372014/11/24 21:31:450B / 10B / 21B
4BioFALSE390.03002014/11/15 04:11:500B / 15B / 23B

Python _

RankUserSizeTimeDateStatistics
1leonid720.20922014/11/25 06:31:330B / 36B / 35B
2whatisgolf730.17462014/11/23 16:29:120B / ?B / ?B
3mitchs740.13452014/11/12 03:04:470B / 30B / 43B
4twobit740.16122014/11/12 09:46:340B / 30B / 43B
5hallvabo780.09802014/11/12 07:46:530B / 40B / 36B
6rolf790.11152014/11/13 04:01:010B / 41B / 34B
7llhuii790.11202014/11/21 23:22:270B / 41B / 34B

Scheme _

RankUserSizeTimeDateStatistics
1kaki840.27592014/11/24 01:22:230B / 43B / 40B

JavaScript _

RankUserSizeTimeDateStatistics
1_nderscore690.05432014/11/12 05:26:220B / 29B / 38B
2teebee690.04892014/11/12 06:48:530B / 34B / 33B
3madshall720.04132014/11/12 00:16:390B / 34B / 38B

Lua _

RankUserSizeTimeDateStatistics
1twobit840.03532014/11/12 20:39:540B / 41B / 39B
2teebee840.04032014/11/13 07:01:490B / 35B / 45B
3AndoDaan910.04322014/11/12 07:28:420B / 37B / 50B

C _

RankUserSizeTimeDateStatistics
1llhuii830.03242014/11/15 21:03:510B / 39B / 44B
2twobit990.03352014/11/14 23:20:523B / 50B / 46B
3llhuii810.03182015/02/24 21:55:510B / 38B / 43B

Haskell _

RankUserSizeTimeDateStatistics
1oerjan680.03582014/11/12 08:24:250B / 34B / 32B
2henkma680.03412014/11/12 23:04:340B / 34B / 32B
3int-e680.03492014/11/14 11:48:380B / 34B / 34B

Asymptote _

RankUserSizeTimeDateStatistics
1teebee830.28162014/11/14 06:20:030B / 46B / 34B
2chocobi1450.27082014/11/11 20:18:190B / 83B / 57B

AWK _

RankUserSizeTimeDateStatistics
1teebee320.03212014/11/12 05:49:030B / 7B / 25B
2mitchs320.03942014/11/12 06:25:090B / 10B / 22B
3llhuii320.03602014/11/15 00:40:410B / 8B / 24B

sed _

RankUserSizeTimeDateStatistics
1mitchs220.03282014/11/11 21:17:430B / 2B / 18B
2teebee220.03292014/11/12 05:53:020B / 2B / 18B
3tails220.04392014/11/12 09:08:130B / 2B / 18B
4fizzie220.03302014/11/12 18:34:190B / 2B / 20B
5llhuii220.03262014/11/15 00:42:210B / 2B / 18B
6kaki220.03302014/11/20 15:16:260B / 2B / 18B

xgawk _

RankUserSizeTimeDateStatistics
1mitchs330.04902014/11/11 21:19:060B / 10B / 23B
2teebee330.03332014/11/12 05:51:170B / 7B / 26B
3llhuii330.08182014/11/15 00:41:150B / 8B / 25B

Brainfuck _

RankUserSizeTimeDateStatistics
1mitchs1160.07592014/11/20 13:13:050B / 0B / 116B

GolfScript _

RankUserSizeTimeDateStatistics
1tails190.31252014/11/12 09:16:520B / 3B / 16B

Burlesque _

RankUserSizeTimeDateStatistics
1fizzie260.08502014/11/12 18:37:570B / 5B / 21B
2AndoDaan380.06292014/11/24 15:15:440B / 7B / 31B
3AndoDaan(fizzie)250.04142014/11/25 18:27:500B / ?B / ?B

Vim _

RankUserSizeTimeDateStatistics
1udioica250.05692016/12/03 07:29:200B / ?B / ?B

Language Ranking_

RankLangUserSizeScore
1GolfScripttails1910000
2sedmitchs228636
3BurlesqueAndoDaan(fizzie)257600
4Vimudioica257600
5AWKteebee325937
6Perlteebee335757
7xgawkmitchs335757
8Rubyleonid385000
9Haskelloerjan682794
10JavaScript_nderscore692753
11Pythonleonid722638
12Cllhuii812345
13Asymptoteteebee832289
14Luatwobit842261
15Schemekaki842261
16Brainfuckmitchs1161637

return to the top page