Skip to main content
edited body
Source Link
Riley
  • 11.7k
  • 2
  • 23
  • 53

Brain-Flak, 20 bytes

(([]){[{}]{}([])}{}) 

Try it online!

Explanation

This is a golf off of a solution made by Riley in chat. His solution was:

([])({<{}>{}<([])>}{}) 

If your familiar with Brain-Flak this is pretty self-explanatory. It pushes the stack height and pops one value as it counts down, at the end it pushes the sum of all the runs.

IfIt is a pretty good golf but he zeros both {} and ([]) however these will have a values that only differ by one so if instead we remove the masks and make one of the two negative they should nearly cancel out.

([])({[{}]{}([])}{}) 

Since they always differ by one we have the unfortunate circumstance where our answer is always off by the stack height. In order to remedy this we simply move the beginning of the push to encompass the first stack height.

(([]){[{}]{}([])}{}) 

Brain-Flak, 20 bytes

(([]){[{}]{}([])}{}) 

Try it online!

Explanation

This is a golf off of a solution made by Riley in chat. His solution was:

([])({<{}>{}<([])>}{}) 

If your familiar with Brain-Flak this is pretty self-explanatory. It pushes the stack height and pops one value as it counts down, at the end it pushes the sum of all the runs.

If is a pretty good golf but he zeros both {} and ([]) however these will have a values that only differ by one so if instead we remove the masks and make one of the two negative they should nearly cancel out.

([])({[{}]{}([])}{}) 

Since they always differ by one we have the unfortunate circumstance where our answer is always off by the stack height. In order to remedy this we simply move the beginning of the push to encompass the first stack height.

(([]){[{}]{}([])}{}) 

Brain-Flak, 20 bytes

(([]){[{}]{}([])}{}) 

Try it online!

Explanation

This is a golf off of a solution made by Riley in chat. His solution was:

([])({<{}>{}<([])>}{}) 

If your familiar with Brain-Flak this is pretty self-explanatory. It pushes the stack height and pops one value as it counts down, at the end it pushes the sum of all the runs.

It is a pretty good golf but he zeros both {} and ([]) however these will have a values that only differ by one so if instead we remove the masks and make one of the two negative they should nearly cancel out.

([])({[{}]{}([])}{}) 

Since they always differ by one we have the unfortunate circumstance where our answer is always off by the stack height. In order to remedy this we simply move the beginning of the push to encompass the first stack height.

(([]){[{}]{}([])}{}) 
added 210 characters in body
Source Link
Wheat Wizard
  • 102.9k
  • 23
  • 299
  • 697

Brain-Flak, 20 bytes

(([]){[{}]{}([])}{}) 

Try it online!

Explanation

This is a golf off of a solution made by Riley in chat. His solution was:

([])({<{}>{}<([])>}{}) 

HeIf your familiar with Brain-Flak this is pretty self-explanatory. It pushes the stack height and pops one value as it counts down, at the end it pushes the sum of all the runs.

If is a pretty good golf but he zeros both {} and ([]) however these will have a values that only differ by one so if instead we remove the masks and make one of the two negative they should nearly cancel out.

([])({[{}]{}([])}{}) 

Since they always differ by one we have the unfortunate circumstance where our answer is always off by the stack height. In order to remedy this we simply move the beginning of the push to encompass the first stack height.

(([]){[{}]{}([])}{}) 

Brain-Flak, 20 bytes

(([]){[{}]{}([])}{}) 

Try it online!

Explanation

This is a golf off of a solution made by Riley in chat. His solution was:

([])({<{}>{}<([])>}{}) 

He zeros both {} and ([]) however these will have a values that only differ by one so if instead we remove the masks and make one of the two negative they should nearly cancel out.

([])({[{}]{}([])}{}) 

Since they always differ by one we have the unfortunate circumstance where our answer is always off by the stack height. In order to remedy this we simply move the beginning of the push to encompass the first stack height.

(([]){[{}]{}([])}{}) 

Brain-Flak, 20 bytes

(([]){[{}]{}([])}{}) 

Try it online!

Explanation

This is a golf off of a solution made by Riley in chat. His solution was:

([])({<{}>{}<([])>}{}) 

If your familiar with Brain-Flak this is pretty self-explanatory. It pushes the stack height and pops one value as it counts down, at the end it pushes the sum of all the runs.

If is a pretty good golf but he zeros both {} and ([]) however these will have a values that only differ by one so if instead we remove the masks and make one of the two negative they should nearly cancel out.

([])({[{}]{}([])}{}) 

Since they always differ by one we have the unfortunate circumstance where our answer is always off by the stack height. In order to remedy this we simply move the beginning of the push to encompass the first stack height.

(([]){[{}]{}([])}{}) 
Source Link
Wheat Wizard
  • 102.9k
  • 23
  • 299
  • 697

Brain-Flak, 20 bytes

(([]){[{}]{}([])}{}) 

Try it online!

Explanation

This is a golf off of a solution made by Riley in chat. His solution was:

([])({<{}>{}<([])>}{}) 

He zeros both {} and ([]) however these will have a values that only differ by one so if instead we remove the masks and make one of the two negative they should nearly cancel out.

([])({[{}]{}([])}{}) 

Since they always differ by one we have the unfortunate circumstance where our answer is always off by the stack height. In order to remedy this we simply move the beginning of the push to encompass the first stack height.

(([]){[{}]{}([])}{})