2
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 ordering by the Dice or by the value in alphabetical order or the reverse, Gothic 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 must go to the end. If the array item is repeated all repeats must be in sequence.
The language of example does not matter, I only care about the development of the idea.
And you have an object or an array as input?
– Sergio
@Sergio could be the 2 cases and even a String in the future, but at the moment it would only be for object and array
– RodrigoBorth
And what do you do to cases where it doesn’t exist? For example
kl
in the order that does not exist in this array example– Sergio
@Sergio must follow the next, in the same way as an alphabetical ordering
– RodrigoBorth
Okay, I put an answer. I have to leave, if that’s not what you’re looking for I can adjust it later. There are probably more answers...
– Sergio