Generate Probabilities around a Numpad Inspired by this question earlier today, I'd like to see interesting ways various programming languages can turn a numpad into probabilities. Commonly, tile-based games will allow you to use a numpad to move in any direction based on where your character currently is. When making an AI for these games, Math.random() * 8 is not sufficient, so I had to get a little creative to make the movement look and feel somewhat natural.

A numpad is defined as such:

7 | 8 | 9
- - - - -
4 | x | 6
- - - - -
1 | 2 | 3


Please note, 5 is an invalid number, as you cannot move onto yourself.

All examples will use these probabilities: [50, 40, 30, 20, 10]

If I wanted to generate probabilities around 8, it would look like this:

40 | 50 | 40 
-- | -- | --
30 | xx | 30
-- | -- | --
20 | 10 | 20


The output would be [20, 10, 20, 30, 30, 40, 50, 40] (with 5 omitted) or [20, 10, 20, 30, null, 30, 40, 50, 40] (with 5 present)

If I wanted to generate them around 1, it would look like this:

30 | 20 | 10
-- | -- | --
40 | xx | 20
-- | -- | --
50 | 40 | 30


The output would be [50, 40, 30, 40, 20, 30, 20, 10] (with 5 omitted) or [50, 40, 30, 40, null, 20, 30, 20, 10] (with 5 present)

You may write a full program that takes the input in any usual way (command line, stdin) and prints the output, or you may write a function with a number argument, that prints or returns the output. Your program or function should accept one number - the position to generate around. You should use these probabilities: [50, 40, 30, 20, 10] (they do not have to be hardcoded). 

Shortest code in bytes wins. Standard loopholes are disallowed. Answers posted in the linked thread are disallowed. Trailing or leading spaces are allowed. You may treat position 4 as absent or empty, depending on your preference. I'm not too picky on output format - print it out as comma-separated strings or as an array.

(This is my first question, go easy on me!)
CJam, 27 bytes

12369874s_$\_r#m&lt;f{#4-z)0S}


Try it online in the CJam interpreter.

Idea

If we go through the digits around 5 in counterclockwise fashion, we obtain the string 12369874 or any of its rotations (depending on the starting point).

After rotating this string so that the input digit n is at the leftmost position, the digits in the rotated string have the following probabilities:

50 40 30 20 10 20 30 40


If we consider the indexes of these digits, which are

 0  1  2  3  4  5  6  7


subtract 4 from each to yield

-4 -3 -2 -1  0  1  2  3


and take absolute values to get

 4  3  2  1  0  1  2  3


we only have to add 1 and append a 0 to get the desired probabilities.

Code

12369874s                   e# Push "12369874".
         _$                 e# Push a sorted copy, i.e., "12346789".
           \                e# Swap it with the unsorted original.
            _r#             e# Find the index of the input in an unsorted copy.
               m&lt;           e# Rotate the unsorted original that many units left.
                 f{       } e# For each character C in "12346789":
                            e#   Push the rotated string.
                   #        e#   Find the index of C.
                    4-      e#   Subtract 4.
                      z     e#   Compute the absolute value.
                       )    e#   Add 1.
                        0S  e#   Push a 0 and a space.