Skip to main content
Share Your Experience: Take the 2024 Developer Survey
1 of 3
Domenico
  • 2.3k
  • 9
  • 25

COW, 159 bytes

oomMMMmoOMMMMMMmoOMMMMMMmoOMMMmoOoomMMMmoOMMMMMMmoOMMMMMMmoOMMMmOoMOOmOomOomOomOomOomOoMOOMOomoOmoOMOOMoOmoOmoOMOOMOomoOmoOMoOMMMOOOmooOOOmooOOOmooMMMmoomoOOOM

Try it online!

How

[0]: n to be decreased   [1]: n   [2]: n to be increased   [3]: n   [4]: m to be decreased   [5]: m   [6]: m to be increased   [7]: m

i=>==>==>=>i=>==>==>=<            | set up memory cells as above
[                                 | loop until some cell becomes 0
    <<<<<<[->>[+>>[->>+=*]*]*]=   | increment and decrement both n and m
]>o                               | print the reduntant copy of the smaller

moo ]    mOo <    MOo -    OOO °    OOM i
MOO [    moO >    MoO +    MMM =    oom o
Domenico
  • 2.3k
  • 9
  • 25