So my aim:
put the value n
into a cell with smallest amount of instructions.
I could do +
twenty times for the value 20.
But a shorter way is for example to do >++++[<+++++>-]<
.
How could I calculate the optimized value setter (assuming that the cell is zero and I can only use this and the right cell) in python?
My thoughts so far: if I can find minimum values for a
, b
, and c
, so that a+b*c=my number
, then the algorithm would look like this:
>(b times +/-)[<(c times +/-)>-]<(a times +/-)
.
Plus or minus because of possibilities to wrap around 0<->255