Skip to main content
added 640 characters in body
Source Link
primo
  • 33.7k
  • 5
  • 63
  • 142

Ruby 271 + 5363 = 5634

1.upto(255){|n|r=n>(o=n>128?256-n:n)??-:?+;puts o>20?(s=o.to_s(i=(3..9).find{|i|!(s=o.to_s i)[1..-2][s[0]]}).bytes;s[-1]+=s[0]%8;(s[1,9].reverse.map{|c|(c-=s[0])<0??-*-c:c>0??+*c:?-}*?>+'[>'+?+*(s[0]%8)).tr(n>o ?'+-':'','-+')+'[-<'+?+*i+'>]<<]'+(s[-1]>s[0]?'':?>+r)):r*o} 

Try it online!

Converts each value to the smallest base which doesn't contain a zero its initial digit at any other place, and then converts from that base. Values greater than 127 are calculated as their inverses.


Non-Wrapping, 221 + 5888 = 6109

1.upto(255){|n|puts n>20?(s=n.to_s(i=(3..9).find{|i|!(s=n.to_s i)[1..-2][s[0]]}).bytes;s[-1]+=s[0]%8;s[1,9].reverse.map{|c|(c-=s[0])<0??-*-c:c>0??+*c:?+}*?>+'[>'+?+*(s[0]%8)+'[-<'+?+*i+'>]<<]'+(s[-1]>s[0]?'':?>+?-)):?+*n} 

Using the same approach as above, with non-wrapping cells.

Try it online!

Ruby 271 + 5363 = 5634

1.upto(255){|n|r=n>(o=n>128?256-n:n)??-:?+;puts o>20?(s=o.to_s(i=(3..9).find{|i|!(s=o.to_s i)[1..-2][s[0]]}).bytes;s[-1]+=s[0]%8;(s[1,9].reverse.map{|c|(c-=s[0])<0??-*-c:c>0??+*c:?-}*?>+'[>'+?+*(s[0]%8)).tr(n>o ?'+-':'','-+')+'[-<'+?+*i+'>]<<]'+(s[-1]>s[0]?'':?>+r)):r*o} 

Try it online!

Converts each value to the smallest base which doesn't contain a zero its initial digit at any other place, and then converts from that base. Values greater than 127 are calculated as their inverses.

Ruby 271 + 5363 = 5634

1.upto(255){|n|r=n>(o=n>128?256-n:n)??-:?+;puts o>20?(s=o.to_s(i=(3..9).find{|i|!(s=o.to_s i)[1..-2][s[0]]}).bytes;s[-1]+=s[0]%8;(s[1,9].reverse.map{|c|(c-=s[0])<0??-*-c:c>0??+*c:?-}*?>+'[>'+?+*(s[0]%8)).tr(n>o ?'+-':'','-+')+'[-<'+?+*i+'>]<<]'+(s[-1]>s[0]?'':?>+r)):r*o} 

Try it online!

Converts each value to the smallest base which doesn't contain a zero its initial digit at any other place, and then converts from that base. Values greater than 127 are calculated as their inverses.


Non-Wrapping, 221 + 5888 = 6109

1.upto(255){|n|puts n>20?(s=n.to_s(i=(3..9).find{|i|!(s=n.to_s i)[1..-2][s[0]]}).bytes;s[-1]+=s[0]%8;s[1,9].reverse.map{|c|(c-=s[0])<0??-*-c:c>0??+*c:?+}*?>+'[>'+?+*(s[0]%8)+'[-<'+?+*i+'>]<<]'+(s[-1]>s[0]?'':?>+?-)):?+*n} 

Using the same approach as above, with non-wrapping cells.

Try it online!

added 127 characters in body
Source Link
primo
  • 33.7k
  • 5
  • 63
  • 142

Ruby 237271 + 55965363 = 58335634

1.upto(255){|n|puts n>20?n>233??-*|n|r=n>(o=n>128?256-n:n)??-:?+;puts o>20?(s=ns=o.to_s(i=(3..9).find{|i|!(s=ns=o.to_s i)[1..-2][s[0]]}).bytes;s[-1]+=s[0]%8;s[11]+=s[0]%8;(s[1,9].reverse.map{|c|(c-=s[0])<0??-*-c:c>0??+*c:?+-}*?>+'[>'+?+*(s[0]%8)).tr(n>o ?'+-':'','-+')+'[-<'+?+*i+'>]<<]'+(s[-1]>s[0]?'':'>-'?>+r)):?+*nr*o} 

Try it online!Try it online!

Converts each value to the smallest base which doesn't contain a zero its initial digit at any other place, and then converts from that base. Values greater than 127 are calculated as their inverses.

Ruby 237 + 5596 = 5833

1.upto(255){|n|puts n>20?n>233??-*(256-n):(s=n.to_s(i=(3..9).find{|i|!(s=n.to_s i)[1..-2][s[0]]}).bytes;s[-1]+=s[0]%8;s[1,9].reverse.map{|c|(c-=s[0])<0??-*-c:c>0??+*c:?+}*?>+'[>'+?+*(s[0]%8)+'[-<'+?+*i+'>]<<]'+(s[-1]>s[0]?'':'>-')):?+*n} 

Try it online!

Converts each value to the smallest base which doesn't contain a zero its initial digit at any other place, and then converts from that base.

Ruby 271 + 5363 = 5634

1.upto(255){|n|r=n>(o=n>128?256-n:n)??-:?+;puts o>20?(s=o.to_s(i=(3..9).find{|i|!(s=o.to_s i)[1..-2][s[0]]}).bytes;s[-1]+=s[0]%8;(s[1,9].reverse.map{|c|(c-=s[0])<0??-*-c:c>0??+*c:?-}*?>+'[>'+?+*(s[0]%8)).tr(n>o ?'+-':'','-+')+'[-<'+?+*i+'>]<<]'+(s[-1]>s[0]?'':?>+r)):r*o} 

Try it online!

Converts each value to the smallest base which doesn't contain a zero its initial digit at any other place, and then converts from that base. Values greater than 127 are calculated as their inverses.

edited body
Source Link
primo
  • 33.7k
  • 5
  • 63
  • 142

Ruby 237 + 57395596 = 59765833

1.upto(255){|n|puts n>20?n>233??-*(256-n):(s=n.to_s(i=(23..9).find{|i|s=n|i|!(s=n.to_s i;!s[1i)[1..-1][s[0]]2][s[0]]}).bytes;s[-1]+=s[0]%8;s[1,9].reverse.map{|c|(c-=s[0])<0??-*-c:c>0??+*c:?+}*?>+'[>'+?+*(s[0]%8)+'[-<'+?+*i+'>]<<]'+(s[-1]>s[0]?'':'>-')):?+*n} 

Try it online!Try it online!

Converts each value to the smallest base which doesn't contain a zero its initial digit at any other place, and then converts from that base.

Ruby 237 + 5739 = 5976

1.upto(255){|n|puts n>20?n>233??-*(256-n):(s=n.to_s(i=(2..9).find{|i|s=n.to_s i;!s[1..-1][s[0]]}).bytes;s[-1]+=s[0]%8;s[1,9].reverse.map{|c|(c-=s[0])<0??-*-c:c>0??+*c:?+}*?>+'[>'+?+*(s[0]%8)+'[-<'+?+*i+'>]<<]'+(s[-1]>s[0]?'':'>-')):?+*n} 

Try it online!

Converts each value to the smallest base which doesn't contain a zero its initial digit at any other place, and then converts from that base.

Ruby 237 + 5596 = 5833

1.upto(255){|n|puts n>20?n>233??-*(256-n):(s=n.to_s(i=(3..9).find{|i|!(s=n.to_s i)[1..-2][s[0]]}).bytes;s[-1]+=s[0]%8;s[1,9].reverse.map{|c|(c-=s[0])<0??-*-c:c>0??+*c:?+}*?>+'[>'+?+*(s[0]%8)+'[-<'+?+*i+'>]<<]'+(s[-1]>s[0]?'':'>-')):?+*n} 

Try it online!

Converts each value to the smallest base which doesn't contain a zero its initial digit at any other place, and then converts from that base.

added 216 characters in body
Source Link
primo
  • 33.7k
  • 5
  • 63
  • 142
Loading
deleted 3 characters in body
Source Link
primo
  • 33.7k
  • 5
  • 63
  • 142
Loading
added 33 characters in body
Source Link
primo
  • 33.7k
  • 5
  • 63
  • 142
Loading
deleted 2 characters in body
Source Link
primo
  • 33.7k
  • 5
  • 63
  • 142
Loading
Source Link
primo
  • 33.7k
  • 5
  • 63
  • 142
Loading