i want to make a history of selections in a two dimensional array.
What i got is this: 

```
var fighters = [
["Ryu", "E.Honda", "Blanka", "Guile", "Balrog", "Vega"],
["Ken", "Chun Li", "Zangief", "Dhalsim", "Sagat", "M.Bison"]
];

var initial_position = (0,0)
var moves = ['right', 'down', 'left', 'left', 'left', 'left', 'right']

```

What i want as a result is e.g.:

```
['E.Honda', 'Chun Li', 'Ken', 'M.Bison', 'Sagat', 'Dhalsim', 'Sagat']

```

the position [0,0] is in the top corner.
My problem is to decide whether the selection goes of the first Row that means the selected fighter would be the first one in the row. But the selection must not go over top oder under bottom row!

Can you help me with this problem?