Resistor Color Duo

in #italast month

class ResistorColorDuo {

static int value(List<String> colorsInput) {
    return 10*getColorValue(colorsInput[0])+getColorValue(colorsInput[1]);
  }

    private static int getColorValue(String colors) {
        switch(colors){
            case 'black':
                return 0
            case 'brown':
                return 1
            case 'red':
                return 2
            case 'orange':
                return 3
            case 'yellow':
                return 4
            case 'green':
                return 5
            case 'blue':
                return 6
            case 'violet':
                return 7
            case 'grey':
                return 8
            default:
                return 9 
        }
    }

}

Sort:  

Thank you, friend!
I'm @steem.history, who is steem witness.
Thank you for witnessvoting for me.
image.png
please click it!
image.png
(Go to https://steemit.com/~witnesses and type fbslo at the bottom of the page)

The weight is reduced because of the lack of Voting Power. If you vote for me as a witness, you can get my little vote.