Created
December 29, 2019 03:33
-
-
Save risingBirdSong/1a9f490fc9f08bd107af58d73552bb5a to your computer and use it in GitHub Desktop.
code war kata "points"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function points(games : string[]){ | |
let ourpoints = 0; | |
games.forEach((val) => { | |
let split = val.split(":"); //? | |
if (split[0] > split[1]){ | |
ourpoints += 3 | |
} | |
else if (split[0] == split[1]){ | |
ourpoints += 1 | |
} | |
}) | |
return ourpoints | |
} | |
points(['1:0','2:0','3:0','4:0','2:1','3:1','4:1','3:2','4:2','4:3']) //? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment