It feels really naive to simply hard code the total score for each combination. The mental load of thinking through who would win and encoding that in a smart way would have taken just as long if not longer than just writing down the correct score for each combination.
This is where pattern matching works really well. Just match each combination with the correspoding score.
I probably thought I could do something clever with assigning values to the letters somehow, so that's why I split out the line into the two letters. Turns out I may as well just be matching on the original line instead of an array of the two letters.
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (1)
I probably thought I could do something clever with assigning values to the letters somehow, so that's why I split out the line into the two letters. Turns out I may as well just be matching on the original line instead of an array of the two letters.