[Question]
  [
My stovetop has 10 different settings of heat (0 through 9) and a very odd way of cycling through them.
* When I hit plus (`+`) it increments the number, *unless* the number is 9 in which case it becomes 0, or the number is 0 in which case it becomes 9.
* When I hit minus (`-`) it decrements the number, *unless* the number is zero in which case it becomes 4.
There are no other temperature control buttons.
So when I am cooking on one temperature and I want to change to another, it's always a bit of a puzzle to figure out what the easiest way to get to that temperature is.
In this challenge you will take a starting temperature and a desired temperature and give the shortest sequence of button presses to get from the starting temperature to the desired temperature.
You should take input as two integers on the range 0-9 and output a sequence of instructions. You may output the instructions either as the characters/strings `+` and `-` or as the numbers `1` and `-1`. If there are two equally minimal sequences you may output either or both.
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") so the goal is to minimize the size of your source code as counted by the number of bytes.
## Test cases
```
0 0 -> ""
0 1 -> "----"
0 2 -> "---"
0 3 -> "--"
0 4 -> "-"
0 5 -> "-+"
0 6 -> "-++"
0 7 -> "+--"
0 8 -> "+-"
0 9 -> "+"
1 0 -> "-"
1 1 -> ""
1 2 -> "+"
1 3 -> "++"
1 4 -> "--"
1 5 -> "--+"
1 6 -> "--++"
1 7 -> "-+--"
1 8 -> "-+-"
1 9 -> "-+"
2 0 -> "--"
2 1 -> "-"
2 2 -> ""
2 3 -> "+"
2 4 -> "++"
2 5 -> "+++"
2 6 -> "++++"
2 7 -> "+++++" or "--+--"
2 8 -> "--+-"
2 9 -> "--+"
8 0 -> "++"
8 1 -> "++----"
8 2 -> "++---"
8 3 -> "++--"
8 4 -> "++-"
8 5 -> "---"
8 6 -> "--"
8 7 -> "-"
8 8 -> ""
8 9 -> "+"
9 0 -> "+"
9 1 -> "+----"
9 2 -> "+---"
9 3 -> "+--"
9 4 -> "+-"
9 5 -> "+-+"
9 6 -> "---"
9 7 -> "--"
9 8 -> "-"
9 9 -> ""
```
  
[Answer]
# JavaScript, 146 144 bytes
```
(a,b)=>{for(z=2;i=a;++z){y=z.toString(2).slice(1);for(x of y)i=x>0?i++?i%10:9:i--?i:4;if(i==b)return a-b?y[r='replaceAll'](0,'-')[r](1,'+'):''}}
```
## Demo
This snippet recreates the test cases from the post.
```
let f =
(a,b)=>{for(z=2;y=z.toString(2,i=a).slice(1);++z){for(x of y)i=x>0?i++?i%10:9:i--?i:4;if(i==b)return a-b?y[r='replaceAll'](0,'-')[r](1,'+'):''}}
// Test all cases from the original challenge
for (const startVal of [0,1,2,8,9]){
    for (const endVal of [...Array(10).keys()]){
        console.log(`${startVal} ${endVal} -> "${f(startVal,endVal)}"`)
    }
}
```
## Explanation
This is my first time golfing, but hey, there has to be a first time for everything.
To explain the code, I'll first format the code and rename variables:
```
function stove(startVal, endVal) {
    for (iterator = 2; y = iterator.toString(2, currentVal = startVal).slice(1); ++iterator) {
        for (x of y) currentVal = x > 0 ? currentVal++ ? currentVal % 10 : 9 : currentVal-- ? currentVal : 4;
        if (currentVal - endVal == 0) return startVal-endVal?y[r = 'replaceAll'](0, '-')[r](1, '+'):''
    }
}
```
and then break it apart to a non-golfed version with comments
```
function stove(startVal, endVal) {
    // Iterate through all possible stove inputs, starting from the shortest
    for (let iterator = 2; true; iterator++) {
        // Reset the currentVal variable every loop
        let currentVal = startVal;
        // Convert iterator to binary to convert it to stove inputs later on
        let bin = iterator.toString(2);
        // Start the iterator at 2 and remove the first character
        // This allows for combinations such as 000/--- to appear when they normally wouldn't
        let buttonSequence = bin.slice(1);
        // Run the stove simulation
        for (const button of buttonSequence) {
            currentVal = button > 0 ? currentVal++ ? currentVal % 10 : 9 : currentVal-- ? currentVal : 4
        }
        // If currentVal and endVal are the same, meaning we've reached the desired end state
        if (currentVal - endVal == 0) {
          // Replace ones and zeroes in the button combination with plusses and minuses, then return
          // If currentVal and endVal are the same, return '' instead, because no button pushes are required
          return (startVal-endVal) ? buttonSequence.replaceAll('0', '-').replaceAll('1', '+') : '';
        }
    }
}
```
Funnily enough, implementing the game was the easiest part, `i=x>0?i++?i%10:9:i--?i:4` runs one round of the entire game, so here's a breakdown of that:
```
// This is true for the string '1' and false for '0'
if (button > 0) {
    // The + button was pressed
    if (currentVal > 0) {
        // If the value is not 0, increase it by one and mod 10 so 9 becomes 0
        currentVal = (currentVal + 1) % 10;
    } else {
        // If the value is 0, set it to 9 as the rules require
        currentVal = 9;
    }
} else {
    // The - button was pressed
    if (currentVal > 0) {
        // If the value is not 0, decrease it
        currentVal--;
    } else {
        // If the value is 0, set it to 4
        currentVal = 4;
    }
}
```
[Answer]
# JavaScript (ES6), ~~88 86 75~~ 74 bytes
Expects `(desired_temp)(starting_temp)`.
```
b=>g=a=>a-b?"+-"[q=a>b^b<"7489001156"[a]^!a^a<4]+g(a?q?a-1:-~a%10:9>>q):""
```
[Try it online!](https://tio.run/##RZFNjpswGIb3OcVXSxV2HTM4P/ykA1m1iy7aRZaZpDIJpFQUJsBUGo3aE1Tqpsv2Hj3PXKBHSPGHTVig5wE@vy/2Z/VVtYemuO9EVR@zSx5f0jg5xSpOlEjXhAuyPccqSffpLQkWYeR5Ui59slW7/Qu1V7eLHT9RtT6vlZAr8V29lN4qSpIzWxFyabLzQ9Fk1Mlbh7lNpo5vizLbPFYH6jG3qzddU1Qnytz2viw6Su4qwty8bt6owyfaQpzA0wSgzDrYwscpqCmkU6gfOthBDK37RXX9dzf07sgAbyIBQt1XjNyw12awyfp1IKc8ZZQrfHyoq7YuM7es@@a45LvNh/dui2WK/JH2M2w6TMYYtwbn39@fz79/9XcHVuA8//nh9Gt9YxcPPIwlEw8kkugvbTNrWuZGNC8G1rgckGv2DaMEKHwYCI1ojgYmE2mChUZpOkiTiu@HTI68GPOlDRX4wreCFpgOw4ehNS3RWHVmk4VmaVvMTLamuW0xM8kceWkYxbeCFoyGGtpauHB0bRyacI4sDQ97Htq/50bno2qzTVCW19MJx03QHNj/CU0JTeOuRzZeo7SHpCcjG25sfj3ByEYjm00QuIR/rRHZaOTQ1ohMOPkP "JavaScript (Node.js) – Try It Online") (test cases)
[Try it online!](https://tio.run/##VVLLTuMwFN3nK24j0SQKKYnUAVrXibplMSxYVqlkF6cYBZvmgTQalS9Amg1L@A@@hx/gEzrXScxDUa7te849tu/xLXtg9aaS902k9LU4FK3aNFIrqHX5IHx2DDyAvw5AKRrgom6AQgInEB8bBi5WOUG00JVvGAozMcFhAadTHMOwr@7rl4iiosbBdUmXtoWyL1zCiAKH8RgTKEFAfin0GndStTWSFaQpksaQkAHVEKJuGLmrjpPbvNl1CdlQmeE8wivMwV9CCEkAR5DEuLTwFOezvnbfRVkgk1LbiCGlJ6VQ2@YGj2nagphtj0WI7ZDOySAFIMpa/Cg3wqYOrzxC/kSqTdlei9rXgdE0qfu2vsGlFTHR/JVo2qozijh7xynogdN0SxlNWcSzrhE7ylK@5gv3bHo@i@Mk@XXqrli@HrE1W0zzcOuzbJexKJlHj@woieezNN0Fc9c9WF9Y7wuDBcWuALN2WJz3OB9w/tPwvgHfnhL5hCphXCx8HvhsSG@0QqqYlBrPhd54@IUobWcXV5e/J3VTSbWVxR8fFYLuFXbhq3Emjz56H2//3l@eMXroqPf@@uR1@@yd/eE/ "JavaScript (Node.js) – Try It Online") (all cases, checked against an ungolfed brute force search)
### How?
The most natural behavior is to hit `+` when the desired temperature \$b\$ is greater than the current temperature \$a\$, and to hit `-` when it's lower.
Below are all the cases where we need to do the opposite of the natural behavior, along with the corresponding test on \$b\$ according to \$a\$:
```
   | 0 1 2 3 4 5 6 7 8 9 | test
---+---------------------+-------
 0 | X X X X X X X - - - | b < 7
 1 | - - - - X X X X X X | b > 3
 2 | - - - - - - - - X X | b > 7
 3 | - - - - - - - - - X | b > 8
 4 | - - - - - - - - - - | none
 5 | - - - - - - - - - - | none
 6 | X - - - - - - - - - | !b
 7 | X - - - - - - - - - | !b
 8 | X X X X X - - - - - | b < 5
 9 | X X X X X X - - - - | b < 6
```
This can be encoded with the following lookup table:
```
[b < 7, b > 3, b > 7, b > 8,,, !b, !b, b < 5, b < 6][a]
```
By normalizing all tests to \$b<t\_a\$ and inverting the result when \$a\in\{1,2,3\}\$, this can be further optimized to:
```
b < "7489001156"[a] ^ !a ^ a < 4
```
The result is XOR'ed (again) with the test `a > b`, leading to either \$0\$ for `+` or \$1\$ for `-`.
We then do a recursive call where \$a\$ is updated using the same logic as in [my answer](https://codegolf.stackexchange.com/a/218367/58563) to [the reverse challenge](https://codegolf.stackexchange.com/q/218360/58563) and keep going that way until \$a=b\$.
[Answer]
# [Haskell](https://www.haskell.org/), 89 bytes
```
g s=f[[s]]
f((w:a):x)e|e==w=a|1>0=f(x++[w!d:a++[d]|d<-[1,-1]])e
9!1=0
0!1=9
0!_=4
t!d=t+d
```
[Try it online!](https://tio.run/##HYzBjsIgAETvfMVgPMCWNsV4sE3xC9zTHgkxKFQ3ajVCg4f@e0Uv8zLJzDvbcPHX6zyfEFSvdTCG9Iyl1vL2xf3klUrKTnJbq569ikIn6lqb6czkulJLUUpjuCcNlaomdc4m516tSaROxcLN0YcIiwMUxiHdny5Ah/M9wQp8eRC42QcYW5QoFqCUo0IYj0cOdvo8uSHkZv@HbMjD3z0eY/yLz92AJb72brmFroUUK7ERjUH38@lV1Zj5DQ "Haskell – Try It Online")
[Answer]
# JavaScript (node.js), 125 bytes
```
g=(q,r)=>(o=[],f=((v,r)=>!o[r]||v.length<o[r].length?(o[r]=v,f(v+'+',r?(r+1)%10:9),f(v+'-',r?r-1:4)):0),f('',q),q==r?'':o[r])
```
[Try it online!](https://tio.run/##Lc/BCoMwDAbg@57CCSMNqaKwy9Tqg4gHceo2xK5RevLdXavL4Sf/dwjk09p26fj9XaNZP/t9H5UwklGVQqu6kYMSwh79qmtuts3GUz@P66vw9b9Xwhdl5SAsAYHkSjCleEuT7IGnRl45SrM7YpZ4BJAGpVGKK4DMX8D8MmgOhFFJborUBRGexI7YE3sK3HR6XvTUx5Me3SkyBAEQu4zKIAQajzcIQsB8338 "JavaScript (Node.js) – Try It Online")
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 65 bytes
```
t=>g=(s,o='',...r)=>s-t?g(...r,s%9?s+1:9-s,o+'+',s?s-1:4,o+'-'):o
```
[Try it online!](https://tio.run/##NcrLCoMwEIXhvU8xm5KEXKjQjdoxzyJWJUEccaSb4rOnsZfV4ec7sXt23G9h3e1CjyGNmHZsJ5RsCIUwzrlNYct295M8w/Cl8qzLurL5ooUWhj3bsr6dZYWqKY20gQyAcG0gwB2hyqu1glcB8MH4xfjD@EeAnhameXAzTTIYiAZGGZUMSjXZj@JIbw "JavaScript (Node.js) – Try It Online")
---
# [Python 3](https://docs.python.org/3/), 82 bytes
```
f=lambda t,s,o="",*r:s-t and f(t,*r,[9-s,s+1][0<s<9],o+"+",[4,s-1][0<s],o+"-")or o
```
[Try it online!](https://tio.run/##Zc2xDsIgFIXh3ae4YQJ7SNro0qZ9EtIBU1GIQsNl8ekRdXQ5yf8tZ3@Ve4qnWt3ysM/LZqmAkRYhcMwT60I2buRkaQkzagZ3w2r6medxRepEJ2DOYP3DL2mhUqZUXVtPPlK28XaVQ6@mA9FHw58S7dnHIj0ooP0FeKXqGw "Python 3 – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~28~~ 25 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
o8r4¤+⁹ị@%⁵
ȷŒPḂo-çƒ³⁼ɗƇḢ
```
A full program that accepts the from and to values which prints a list of `-1`s and `1`s.
[Don't try it online](https://tio.run/##AToAxf9qZWxsef//bzhyNMKkK@KBueG7i0Al4oG1Csi3xZJQ4biCby3Dp8aSwrPigbzJl8aH4bii////OP80 "Jelly – Try It Online") (it's checking \$2^{1000}\$ instruction strings, for golf!)
**[Try it online!](https://tio.run/##AToAxf9qZWxsef//bzhyNMKkK@KBueG7i0Al4oG1CjEyxZJQ4biCby3Dp8aSwrPigbzJl8aH4bii////OP80 "Jelly – Try It Online")** (with a reduction from the powerset of \$1000\$ items to just \$12\$ so it runs in time)
Or [try 10 at a time](https://tio.run/##AV0Aov9qZWxsef//bzhyNMKkK@KBueG7i0Al4oG1CjEyxZJQ4biCby3Dp8aSwq7igbzJl8aH4bii/@KBuMKpw6figbkKOcW7cEBXwrUsw6cvxZLhuZjigqwpS@KCrFn//zg "Jelly – Try It Online"), from the given value to all others. (Takes about 20 seconds; as above, but also uses the register, `®`, in place of the second program argument, `⁴`, since that's not mutable.)
Lastly, [this 26 byter](https://tio.run/##AWkAlv9qZWxsef//bzhyNMKkK@KBueG7i0Al4oG1CjbFu8OYLeG5l@KxruG6jsOnxpLCs@KBvMmXxofhuKL/4oG4wqnDp@KBuQo5xbtbMCwxLDIsOCw5XXDCtSzDpy/FkuG5mOKCrClL4oKsWf8 "Jelly – Try It Online") that only forms strings up to length six is much faster.
### How?
```
o8r4¤+⁹ị@%⁵ - Link 1, make a move: current value, V ([0,9]); button, B (+/-1)
 8r4¤       - [8,7,6,5,4]
o           - V logical OR that (either [V,V,V,V,V] or [8,7,6,5,4] if V=0)
     +⁹     - add B to each of those values
       ị@   - use B to index into that list
              (1-indexed and modular: if B=1 the first; if B=-1 the fourth)
         %⁵ - modulo 10
ȷŒPḂo-çƒ³⁼ɗƇḢ - Main Link: from, F ([0,9]); to, T ([0,9])
ȷ             - 1000 (saves a byte over `12`)
 ŒP           - powerset (shorter strings come first)
   Ḃ          - modulo 2
    o-        - logical OR -1 (vectorises)
           Ƈ  - filter keep those for which:
          ɗ   -   last three links as a dyad - f(instruction, T)
        ³     -     first program argument, V
       ƒ      -     reduce [V]+instruction by:
      ç       -       call last Link (Link 1) as a dyad
         ⁼    -     equals T?
            Ḣ - head (gets a/the shortest string)
```
[Answer]
# [R](https://www.r-project.org/), 149 bytes
Or **[R](https://www.r-project.org/)>=4.1, 135 bytes** by replacing two `function` occurrences with `\`s.
```
function(a,b,x=combn(rep(-1:1,6),6),y=x[,apply(x,2,function(t){for(i in t)a=(a+i)%%10+"if"(i>0,8,-5)*i*!a;a==b})],z=y[,order(colSums(!!y))[1]])z[!!z]
```
[Try it online!](https://tio.run/##RYzNCsIwEITvPkUSEXabLTSC/8SX8Fh6SKuBgDYlttBWfPZqq@gwl/mGmTBYPdimLGrnSzCUU6sLf8tLCJcKYrVXtMbRnW5TMlV17aClJf0mNT6sD@CYK1mNRoORDhcLlUjhrAB3TGhL8QojF3FzMFrnT8yo111KPpwvAQp/PTW3O3DeIaYqy7BPOe@zwUJCLME5i49MiNkU1TfGb41IEVv/kJQjWhLbfJEcJZgPU/tZ7P4ncnoZXg "R – Try It Online")
Brute-force approach. Probably porting one of the clever non-brute-force solutions would be shorter.
Borrows some code from [Xi'an's answer to the related challenge](https://codegolf.stackexchange.com/a/218588/55372).
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), ~~29~~ 27 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
®X‚6иæé.Δ¹svDy+T%Ƶ₆yè‚s_è}Q
```
Input as two separated integers; output as as a list of `-1,1` for `-+` respectively.
[Try it online](https://tio.run/##ATcAyP9vc2FiaWX//8KuWOKAmjbQuMOmw6kuzpTCuXN2RHkrVCXGteKChnnDqOKAmnNfw6h9Uf//Mgo3) or [verify all test cases](https://tio.run/##AXsAhP9vc2FiaWX/wq5Y4oCaNtC4w6bDqQo5w53Do3ZEeT8iIOKGkiAiP3lgVlX/Ls6UWHN2RHkrVCXGteKChnnDqOKAmnNfw6h9WVH/fcKpP@KApm8rLcKuw6hK4oCmKMO/KTI1wq7igqxnT8K3wq5kTyvCrmdfwrcrLcO6LP8).
Since I was curious: a hard-coded approach of all test cases would be **52 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)** in comparison:
```
•‡fsΣï6ÿîœ½Ii†_³•„+-Åв•3o₂₁∞5û±Õ¸ôk,ƒ
cÆмÄœº•0š£ITβè
```
Input as a pair; output as a list of `-+` characters.
[Try it online](https://tio.run/##yy9OTMpM/f//UcOiRw0L04rPLT683uzw/sPrjk4@tNcz81HDgvhDm8GS87R1D7de2ARkG@c/amp61NT4qGOe6eHdhzYennpox@Et2TrHJnElH267sOdwC1DzLqBCg6MLDy32DDm36fCK//@jjXTMYwE) or [verify all test cases](https://tio.run/##yy9OTMpM/W95eO7hxWWV9koKj9omKSjZ/3/UsOhRw8K04nOLD683O7z/8Lqjkw/t9cx81LAg/tBmsOQ8bd3DrRc2AdnG@Y@amh41NT7qmGd6ePehjYenHtpxeEu2zrFJXMmH2y7sOdwC1LwLqNDg6MJDiytDzm06vOK/l85/AA).
**Explanation:**
```
®X‚            # Push pair [-1,1]
   6и          # Repeat it 6 times as list: [-1,1,-1,1,-1,1,-1,1,-1,1,-1,1]
     æ         # Take the powerset of this
      é        # Sort it by length
.Δ             # Find the first/shortest list that is truthy for:
  ¹            #  Push the first input
   s           #  Swap so the list is at the top again
    v          #  Loop over each of its items `y`:
     D         #   Duplicate the current result
      y+       #   Add `y` to the copy
        T%     #   Modulo-10
      Ƶ₆       #   Push 194
        yè     #   Index `y` into it (1→9; -1→4)
          ‚    #   Pair the two together
           s   #   Swap so the result is at the top again
            _  #   Check if it's 0 (1 if 0; 0 otherwise)
             è #   Index it into the pair
    }          #  Close the loop
     Q         #  Check if it's now equal to the (implicit) second input
               # (after which the found list is output implicitly as result)
```
```
•‡fsΣï6ÿîœ½Ii†_³•
            # Push 664379026224093486851406838200392383
 „+-Åв      # Convert it to custom base-"+-"
            # (basically convert it to base-2, and index into "+-")
  •3o₂₁∞5û±Õ¸ôk,ƒ\ncÆмÄœº•
            # Push 4321233211012234432210123454326543321011543233210
   0š       # Convert it to a list of digits, and prepend a 0
     £      # Split the list of "+-" into lists of that size
      I     # Push the input-pair
       Tβ   # Convert it from a base-10 list to an integer
         è  # Use that to index into the earlier list
            # (after which the list is output implicitly as result)
```
[See this 05AB1E tip of mine (section *How to compress large integers?*)](https://codegolf.stackexchange.com/a/166851/52210) to understand why `Ƶ₆` is `194`; `•‡fsΣï6ÿîœ½Ii†_³•` is `664379026224093486851406838200392383`; and `•3o₂₁∞5û±Õ¸ôk,ƒ\ncÆмÄœº•` is `4321233211012234432210123454326543321011543233210`.
[Answer]
# [Python 3](https://docs.python.org/3/), 97 bytes
```
f=lambda a,b,*c:a!=b<10>len(c)and min((f((-i%7+3,a+i)[a>0]%10,b,*c,i)for i in(-1,1)),key=len)or c
```
[Try it online!](https://tio.run/##HY5NDoIwEIX3nmJckMzIkLSyUInlIsbFFKg2QiGEDaevLZu3@N5P3rJv3znUMTozymR7AWHLl66Rs7FPrdpxCNiRhB4mHxAdYuWLW1mzlJ5e0qp3odVRYU9uXsFDylWaNRH/ht2kAUq4i9mUZAIq1nzlOz@oOQFkbjNfJXwG1OqgAMvqw4b5jstKFP8 "Python 3 – Try It Online")
[Answer]
# [Perl 5](https://www.perl.org/), 131 bytes
```
sub{($_,$w,$s,@t)=@_;@t=sort{length$$b[1]<=>length$$a[1]}@t,[$_?$_-1:4,"$s-"],[$_++?$_%10:9,"$s+"]and($_,$s)=@{pop@t}while$_-$w;$s}
```
[Try it online!](https://tio.run/##XdNbb5swFAfwdz7FEXOWRDZSnAtgGC3vk9aXvqURaleHVkuBgqtsivLZMwd8I5EicX748j9gGt4eNhe0zy7d18tphgqCjgR1JBfzLC/SXGRd3YrTgVeleEPoZUt3P7I7XT7L8pwLskXFPSoCmqyJj7rA310FY2kTukjYFbG/e65e@w06ufSpqZtcnI9v7wcuZ6JjirrzJfX2dTsDbwsLAgvI7sD3YUeGmvZ1IH/WltosrRRZWQ9iYTMAthIqcSjqCbsLxYqssEEUUB06sEDdLqhO7MwY8mJH1uMOqAkcOINCTY5Fqgt3aqzNEhu3vzSpAyt01MdS57b1atTHUqfGjmyUOBRqciwy1iN8g7rtO5N5hhGx7tXJw24eSay7wI5QJc6hic0rwCNcGbSmW3Joc3PgYvsmrESjhxfrBmw9PjbMRLdA9ekz6zITfGSrm2PKTGxH1JsInA3Cm0aYie1IPGqE6eB9PT95AB//Zkjwj4agih@L4YrLzxsVaX8Xldl3tFdjwAyaX@827Xsl9v4kCDuAqybQjwMAPS6xU6Tyvw3/LfhrApMgknOgrIW87p4qn8j1ABAH/gmohHuY1n@mkMD018MjPPycyr25/Jepd/Yu/wE "Perl 5 – Try It Online")
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 46 bytes
```
Ｎθ⊞υ⟦Ｎω⟧ＦυＦ²Ｆ¬⊙υ№λθ⊞υＥι⎇ν⁺μ§+-κ⎇κ⊖∨μ⁵﹪⊕∨μ⁸χ⊟⊟υ
```
[Try it online!](https://tio.run/##XY89C8IwEIZ3f8XhdMErqCAKTkWXDmoHN3GIbaRimrQx58evj40oigfHC/e891VU0hVW6hAy07Bfc31QDlsx7@V8qZAJdr9AENz2HTxaB8gCXjp@69p6TM0jNi0sG4@aoBVdwGfWSjZ4ItgqZ6R7oCHINV@wJkh9Zkp1x/4g6ROchfi6zgRLVThVK@NViRsX/ZPoWNmStcXM/NNZpKNh3B0/cafumNw2r@RYC2EK45Bc9RM "Charcoal – Try It Online") Link is to verbose version of code. Takes the desired temperature first and the starting temperature second. Explanation:
```
Ｎθ
```
Input the desired temperature.
```
⊞υ⟦Ｎω⟧Ｆυ
```
Start a breadth-first search with the starting temperature and no button presses.
```
Ｆ²
```
Check each button.
```
Ｆ¬⊙υ№λθ
```
Stop processing once all the desired temperature has been found.
```
⊞υＥι⎇ν⁺μ§+-κ⎇κ⊖∨μ⁵﹪⊕∨μ⁸χ
```
Calculate the next temperature and push that with its updated list of button presses.
```
⊟⊟υ
```
Output the button presses that reached the desired temperature.
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), 40 bytes
```
;X≜{∧1w₄&{0∧9!|9∧0|+₁}|∧_1w₄&{0∧4|-₁}}ⁱ⁾
```
[Try it online!](https://tio.run/##SypKTM6ozMlPN/pv@Wj@supHHctBtLV9VfWjtg2Pmpofbu0Aij3cuaj8UVNL7cOtE0C8Hdse7uqE8v9bRzzqnAPSaAhSolZtADJDscYSSBnUaD9qaqytATLjkWRNanRBwrWPGjc@atz3/z8A "Brachylog – Try It Online")
Starting temperature through input variable, target temperature through output variable, prints solution at end of program ([+3 bytes if the `1`/`-1` format doesn't extend to strings](https://tio.run/##SypKTM6ozMlPN/pv@Wj@supHHctBtLV9VfWjtg2Pmpofbu0Aij3cuaj8UVNL7cOtE0C8Hdse7uqE8v9bRzzqnAPSqKStBFKkVm0AMkWxxhJIGdRoP2pqrK0BSesiSZvU6ILEax81bnzUuO//fwA); if it's permitted with a separator just replace both `w`s with `ẉ`s). Brute-forces all sequences shortest first until one reaches the target.
Can probably be shorter. [Checked against Arnauld's JS solution.](https://tio.run/##RY3dboMwDEbv9xSepUlBaQpI3VZ@Eh6kLZLDAmqFSIGqN1P36sxZ1@3CtvQdH/tEV5qb6Xi@qMF/uKXVi9Wm06QNKVuhVLgbNRlb2xLfN9ssSdL09Q13dKifqaZyc5CdoGqsSKW5@qKXNMkzY8YoR1xaP4neXYBAQ1LwKDVkPKWM4PMJILD@ODjGiAUHD8HeBfsr2IcAEMeBz77nDe5XJ2gFNip@YECTmxm1giLxF4cXUge0nty5p8aJeC/jboUpRv@RConiCCQgILs3rsYP/Mite9@J@yXA/YB8@7Z8Aw)
[Answer]
# Python3, 168 bytes:
```
lambda *x:min(f(*x),key=len)
def f(a,b,c=''):
 if a==b:yield c
 if len(c)<10:
  yield from f([a+1,[9,0][a==9]][a in[0,9]],b,c+'+')
  yield from f([4,a-1][a!=0],b,c+'-')
```
[Try it online!](https://tio.run/##ZZPbbqMwFEWfy1e4eQHXpsIhFzsa@gn9AYgqh5iOO9yE0aiR5t8zPsYmD@WFtfE53htfxtv8e@hzPk73z6K6t7K7XCV6@T51uk@a5OUb0z/qVrSqx9FVNahJJL3QuohjfIqQbpAsisvpplV7RbX7YEuTGv9imR1Hy0AzDZ3tLCVhtBQ0O5e2S5ztC@m@zKhFmJTEJMY/mnZUpsyWPheZr0pjfNfdOEwzkmamaFKRsYHiKEMZSt/QZmOJOUrtA2obFIjcC@DdwoD7BQnwwbMTRyfI0sC9ABYLbyLmjVNA5jMw7@rGF0/ieLf6s2CauoFDEE4dfYalkAcFQqxRt8E5BWYhxdZ7A@UhxdY7E8d7z04cgnDquConeYjlJhaPxNybE8fM87LmPPw98TJfJaiQxIn9Y3f4ugjAx/A/3IcAWlddBHtAFjYJOkUw9yp/7KAI1o79IqRuisMjhgjWjnmIIbz5JoLj1gwT0vYEo0a3s5qS96FXFJlXM7Z6TuKqj7G9JE/LhenkmNjT@mqH1CTbD/VXtnB012pTpdVbZf5VJqYaY9tnjLJHPPk6FZ9w6zBGRYFqWsKEX7Q@R@Oke9s6KzMbNEL91V6N/w)
[Answer]
# T-SQL, 190 bytes
```
WITH C as(SELECT @ a,cast(''as VARCHAR(max))r
UNION ALL
SELECT(a+iif(a=0,4-5*~p/2,p))%10,r+CHAR(44-p)FROM
C,(VALUES(1),(-1))X(p)WHERE len(r)<6)SELECT
top 1r FROM C WHERE @2=a ORDER BY len(r)
```
**[Try it online](https://dbfiddle.uk/?rdbms=sqlserver_2019&fiddle=e70d9e7179ac3fa6cd5a5ea526c787a9)**
]