I'm looking for a way to create a custom computer.
Let's say I have the following:
var array = [
1=>'A',
2=>'B',
3=>'C',
4=>'D',
5=>'E',
6=>'F',
]
Now instead of sorting by index or value in alphabetical order or the reverse, I would like to pass my own order. It could be anything the user imagines ex:
ordem = acebdukl
ordem = brvdencst
If the array item does not exist in the order, it should go to the end. If the array item is repeated all the reps must be in sequence.
The example language does not matter, I just care about developing the idea.